With the rise of Geographic Information Systems and Science, application developers are finding that relating data in their data bases to physical points on the planet is more and more important. Services like Google Maps, Yahoo Maps and MapQuest have made interactive maps commonplace on web sites
... [More]
, but difficult to manage from the application side.
Many times applications end up tied to one mapping service, and the code is intimately intertwined with JavaScript and API calls to a specific service. This reduces application flexibility and modularity. The PHP Maps API seeks to remove this barrier by giving the PHP developer a common API for managing map data and geocoding (turning street addresses into latitude and longitude coordinates). Maps are treated as a data export type --- more akin to a template. The specific mapping service in use is hidden behind an object oriented wall, so you can concentrate on your application and leave the gritty details of each mapping service up to the PHP Maps API.
In short: changing one line of code can turn your PHP web application from a Google Maps-centric program, to Yahoo! Maps, or to MapQuest Maps, etc.
// Use Google maps..
$mapManager = new Maps_Manager('google' ... );
// Now switch to Yahoo maps...
$mapManager = new Maps_Manager('yahoo' ... );Currently only Google maps are supported, but by utilizing the advances in object oriented programming in PHP 5 adding mapping services is fairly easy. The features that will be available for the 1.0 release are:
Geocoding Google Maps Yahoo Maps MapQuest Calculate distances between two geographic points Map display and data export Google Maps (JavaScript) Yahoo Maps (JavaScript) MapQuest (JavaScript) Associative array, useful for PHP programmers more comfortable with procedural programming Database support PDO (PHP Data Objects). The SQL is pretty simple and should work for most RDMS that PDO supports. Map features Points of Interest Multiple custom icons for Points of Interest Map legend Info windows that pop open when clicking a Point of Interest icon on the map Map sidebar, listing links that open info windows for the map Points of Interest Drawing lines Drawing polygons Driving directions Currently the features not supported are the ability to export map data as a Yahoo or MapQuest maps, and geocoding addresses using the Yahoo or MapQuest services.
Keep checking back for updates! [Less]