Procházet zdrojové kódy

georss api instructions

import/raw
mikel.maron před 18 roky
rodič
revize
d4d1394b2e
3 změnil soubory, kde provedl 46 přidání a 4 odebrání
  1. +21
    -3
      trunk/docs/api.php
  2. +22
    -0
      trunk/docs/templates/apihowto.tpl
  3. +3
    -1
      trunk/docs/templates/header.tpl

+ 21
- 3
trunk/docs/api.php Zobrazit soubor

@@ -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
trunk/docs/templates/apihowto.tpl Zobrazit soubor

@@ -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
trunk/docs/templates/header.tpl Zobrazit soubor

@@ -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>

Načítá se…
Zrušit
Uložit