瀏覽代碼

georss api instructions

master
mikel.maron 17 年之前
父節點
當前提交
652621c246
共有 3 個檔案被更改,包括 46 行新增4 行删除
  1. +21
    -3
      docs/api.php
  2. +22
    -0
      docs/templates/apihowto.tpl
  3. +3
    -1
      docs/templates/header.tpl

+ 21
- 3
docs/api.php 查看文件

@@ -1,5 +1,5 @@
<?php
require_once ("include/config.php");
require_once ("config.php");
require_once ("phpcoord.php");
$api = new api;
@@ -15,8 +15,12 @@ class api {

//Constructor
function api() {
$this->setup();
$this->bind();
if (isset($_GET['howto'])){
$this->howto();
} else {
$this->setup();
$this->bind();
}
}
//setup
@@ -72,6 +76,20 @@ class api {
}

//howto
function howto() {
$form_action = $_SERVER['PHP_SELF'];

$smarty = new Smarty;
$smarty->force_compile = true;
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;

$smarty->assign("page_title","API HOWTO");
$smarty->assign("menu_item","api");

$smarty->display('apihowto.tpl');
}

}




+ 22
- 0
docs/templates/apihowto.tpl 查看文件

@@ -0,0 +1,22 @@
{include file="header.tpl"}

<dl class="faq">
<dt>PlanningAlerts.com API</dt>
<dd>
Planning application data is available programmatically as <a href="http://georss.org/">GeoRSS feeds</a>. GeoRSS can be used in most all web mapping APIs and desktop GIS software, and in services like <a href="http://mapufacture.com">mapufacture</a> and <a href="http://pipes.yahoo.com/">Yahoo Pipes</a>.
<p/>
Construct an api request as follows.
Either lat/lng or postcode is required. area_size is always required.<br>
<p/>
<code>
http://www.planningalerts.com/api.php?<br>
&nbsp;lat=[some latitude]<br>
&nbsp;&lng=[some longitude]<br>
&nbsp;&postcode=[some postcode]<br>
&nbsp;&area_size=['s' 'm' or 'l']
</code>
<p/>
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">an example query</a>
</dd>
</dl>
{include file="footer.tpl"}

+ 3
- 1
docs/templates/header.tpl 查看文件

@@ -19,6 +19,8 @@
<div id="divMenu">
<ul class="collapse">
<li {if $menu_item =="about"}class="selected"{/if}><a href="about.php">About</a></li>
<li {if $menu_item == "api"}class="selected"{/if}><a href="api.php?howto">API</a></li>

<li {if $menu_item =="getinvolved"}class="selected"{/if}><a href="getinvolved.php">Get involved</a></li>
<li {if $menu_item =="faq"}class="selected"{/if}><a href="faq.php"><acronym title="Frequently asked questions">FAQ</acronym>s</a></li>
<li {if $menu_item =="signup"}class="selected"{/if}><a href="/">Signup</a></li>
@@ -34,4 +36,4 @@
<div id="divWarning" {if $warnings == ""}class="hide"{/if}>
{$warnings}
</div>

Loading…
取消
儲存