diff --git a/docs/api.php b/docs/api.php index abd5016..781eec7 100644 --- a/docs/api.php +++ b/docs/api.php @@ -1,5 +1,5 @@ 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'); + } + } diff --git a/docs/templates/apihowto.tpl b/docs/templates/apihowto.tpl new file mode 100644 index 0000000..484ec52 --- /dev/null +++ b/docs/templates/apihowto.tpl @@ -0,0 +1,22 @@ +{include file="header.tpl"} + +
+
PlanningAlerts.com API
+
+ Planning application data is available programmatically as GeoRSS feeds. GeoRSS can be used in most all web mapping APIs and desktop GIS software, and in services like mapufacture and Yahoo Pipes. +

+ Construct an api request as follows. + Either lat/lng or postcode is required. area_size is always required.
+

+ + http://www.planningalerts.com/api.php?
+  lat=[some latitude]
+  &lng=[some longitude]
+  &postcode=[some postcode]
+  &area_size=['s' 'm' or 'l'] +
+

+ an example query +

+
+{include file="footer.tpl"} diff --git a/docs/templates/header.tpl b/docs/templates/header.tpl index 03e4713..4c94397 100644 --- a/docs/templates/header.tpl +++ b/docs/templates/header.tpl @@ -19,6 +19,8 @@