Area Map

Categories

Component ID

2469783

Component name

Area Map

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Creates interactive areas on top of maps. This is useful when the location that needs to be displayed on the map is not a point (like an address) but an area (like a country or state). It also allows to set the zoom level, boundaries, display one or several areas in the same map and customize the colour and action triggered by hovering or clicking on areas.

This module can be used to build maps that represent political or natural boundaries (war-zones, epidemics, deforestation, weather...) in the form of heat-maps, region pickers, popup information about areas in a region, or whatever other use that requires to deal with areas on maps.

This module depends on the excellent Leaflet mapping module. There might be an option to use a different mapping module (like OpenLayers) in the future (patches are welcome!).

The format used to describe areas is GeoJSON, an open standard format for geographical features.

Installation:

To install all dependencies you can use drush: drush en -y area_map. The javascript libraries need to be installed manually.

Dependencies:

  • field
  • geofield
  • geophp
  • views
  • views_geojson
  • libraries
  • leaflet
  • leaflet_views
  • leaflet_geojson

You will also need to download the Leaflet library. Make sure the library is available at this path (create the libraries folder and rename the leaflet folder if needed)

  • sites/all/libraries/leaflet

Recomended modules:

Leaflet Label can be used to display labels when hovering over areas. Labels can be configured to display a field of the given entity. You will also need to download the Leaflet Label library and place it in:

  • sites/all/libraries/leaflet_label

Views Autocomplete Filters provides auto-complete functionality to views. Since we use views to display several areas in one map, you can use views exposed filters to allow users to search for an area. Autocomplete functionality can come very handy in this case.

Similar modules

jQuery Map Highlight provides highlight on images, including SVG images of geographical areas. It differs from this module because it does not provide a full map interface with zoom/drag controls nor the map tiles.

Roadmap:
-Create a configuration page
-Ability to create areas as nodes or as taxonomy terms
-Customize map interaction
-Create heat-map colouring
-Translate SVG images to readable GeoJSON (?)
-Add support for other mapping modules like OpenLayers (?)