Beyond Google Maps: Mapstraction is a good starting point

cover image for Beyond Google Maps: Mapstraction is a good starting point

Some shops on map
A List Apart 256 has a very interesting article on Taking Control of Your Maps, explaining how to provide richer and more customized web map solutions using tools like OpenLayers and Mapnik, and the free data provided by OpenStreetMap:

For the practical developer who wants to add geospatial information to a site or application, the Google Maps API has been an easy call.

But, perhaps no longer. As websites mature and the demand for geographic applications grow, the old mashup arrangement is starting to chafe. Mapping components are more and more vital, and so we demand greater control, expressiveness, and functionality from them.

Fortunately, as in many aspects of internet technology, an ecology of open source online mapping tools has emerged alongside the market leader. It is now possible to replicate Google Maps’ functionality with open source software and produce high-quality mapping applications tailored to our design goals. The question becomes, then, how?

While setting up your own map server might be a lot of effort, Mapstraction could provide a nice way to move beyond the "same old" Google Maps. With the same javascript you can experiment with different map providers like OpenStreetMap, Yahoo! and Microsoft.

Mapstraction comes bundled with Midgard's GeoCMS component, org.routamc.positioning. Switching map providers can be done in component configuration, and then displaying things on a map is very straightforward:

$map = new org_routamc_positioning_map('my_photo_map');
foreach ($photos as $photo)
{
    $map->add_object($photo);
}
$map->show(400, 200);

Technorati Tags: mapstraction, midcom, midgard, openlayers, openstreetmap, mapnik


Read more Midgard posts.