Jul 7, 2011

Integrating Open layers and Geocoder in Drupal

Integrating Open layers and Geocoder in Drupal
Required Modules:

  • Enable all the required modules
  • Add a content type     eg : ‘Geo Map’
    • Create a field on the Content type by clicking on ‘Managing Fields
      • Select the ‘ Openlayers WKT’ as your type data to store.
      • and ‘Openlayers Geocoder’ Form element type.
      • Save the content type

  • Now lets create preset
    • Go to admin/build/openlayers/presets/
      • Clone one of the existing preset ‘eg : Default’
      • Rename the fields as you want
      • and save the preset
      • Now you should find your newly created preset in the admin/build/openlayers/presets/ list.
    • Click edit on your preset
    • Save your preset

Re-check whether you have selected the correct map preset in /admin/build/openlayers - Openlayers Default Preset, and Click ‘Save Configurations’.
  • Now go back to our created ‘View’
    • Add a ‘Page’ display
    • In Basic settings
    • Change the style options into ‘OpenLayers Map’
    • and click ‘override’ and then ‘update’

  • We are almost done with our configurations

  • Next lets create a ‘Content’
    • The content type is supposed to be the content type you created above.
    • And you’ll see your map appearing
    • select a location in the map
    • or type location in the ‘Search address’ autocomplete field
    • and click Save.


Follow by Email