Online Book Reader

Home Category

Mapping With Drupal - Alan Palazzolo [48]

By Root 284 0
module. The module comes with support for Google Maps, OpenStreetMap, Bing, Yahoo!, CloudMade, and more. OpenLayers is intended as (and is) a versatile way of displaying almost any sort of geographical data.

Available Base Layers


Of the many base layers available, four will be discussed here: Google Maps, MapQuest, CloudMade, and MapBox, as well as a tool that lets you create your own map tiles.

Google Maps tiles


Both GMap and OpenLayers support the various Google Maps tilesets. These are fairly well known; they include a Road set, a Satellite set, a Hybrid of the two, and a Physical set that shows elevation and contour, shown in Figure 6-17.

Figure 6-17. Google Maps Physical layer

MapQuest tiles


MapQuest was one of the original organizations doing web mapping. Recently they partnered with OpenStreetMap, an online, open (wiki-style) map of the world. MapQuest has released a free tileset based on the OpenStreetMap data (shown in Figure 6-18), as well as a free tileset of satellite imagery (shown in Figure 6-19). You can find out more about these and the associated API in their developer documentation.

In upcoming versions of the OpenLayers modules, these new layers will be available by default.

Figure 6-18. MapQuest’s OpenStreetMap tiles

Figure 6-19. MapQuest’s Open Aerial tiles

CloudMade


CloudMade provides location-based services. Their Style Editor is a free web-based tool for creating custom tilesets from OpenStreetMap data. This is the easiest and most inexpensive way to get custom map tiles for your site. Figure 6-20 is a screenshot from the Style Editor showing some of the styles that people have created.

Figure 6-20. CloudMade Style Editor browser

The OpenLayers module has support for CloudMade tilesets. This requires downloading another library, but there are instructions within the module at admin/structure/openlayers/layers/settings.

MapBox


Development Seed is a company that has made a suite of open source mapping tools, known as MapBox. Among their many great contributions to the open source world, a lot of their tilesets are available to use for free. You can browse them at tiles.mapbox.com.

There is a MapBox module that provides base layers to both GMap module and the OpenLayers module. With the OpenLayers module, you can add a wide selection of MapBox base layers from the many tilesets, while the GMap integration only provides a select few. The MapBox module also provides a number of nice icons for use in the OpenLayers module.

TileMill


TileMill is part of the MapBox suite of tools. TileMill makes it possible to create custom tilesets from your own data sources. It runs as an application on Mac OS X or Ubuntu, takes in multiple data sources, and uses a CSS-like style language called Carto to create tilesets that can then be exported for use in your maps. TileMill is a great way to make tilesets, but it does not include a way to host them to use in web applications. Serving tilesets is handled by another MapBox product called TileStream, or by configuring your own very fast map tile server.

Chapter 7. Managing Maps as Features


Throughout the tutorials in this book, all the configuration has been done through the user interface. Drupal stores this configuration in your database, which is a problem for two main reasons:

It is difficult to manage these changes when deploying or changing environments.

There is no history log of modifications.

One tool that has been developed over the last couple of years to solve this is the Features module. With the Features module, all the work you have done configuring your map settings can be bundled up and saved in a handy format. You can then reuse the configurations in your next mapping project, and share them with other Drupal developers. Your settings can be easily backed up with version control. For more background on Features, see the Features handbook page.

Features is well supported by OpenLayers and Geofield. Much of the configuration for maps built with GMap and Location is based on

Return Main Page Previous Page Next Page

®Online Book Reader