Dynamic Google Maps in Drupal Geolocation Field

Standard Geolocation Field in Drupal 7 allows displaying of content only as a static image, using static Google Maps API. This solution is very limited: users can't scroll the map, zoom it nor change display type. I've implemented a patch which allows you to replace this image with dynamic, scrollable and zoomable map, which you know from many sites (including http://maps.google.com :) ).

Here is how static Google Map - without my patch - looks like:

Static Google Map

The new google map is similair to the following:

As you see, you can click and move the second map around or zoom it if you wish. You could even change map type to satellite or hybrid if you wish. Static map does not allow any of these operations.

The patch is published in Drupal Issue Queue and awaiting review. It adds new formatter type - Dynamic Google Map - that can be selected instead to old, static google map when editing content type display preferences (Structure - Content types - select content type and then Manage Display).

To link with Google Maps API, I've attached some JavaScript to new element returned by hook_field_formatter_view.



Thank you very much. Hope it ships soon.

Dynamic Google Maps patch was committed into Geolocation Field module repository. It's available in the latest development release of this module: http://drupal.org/project/geolocation .

Add new comment


  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <small>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
By submitting this form, you accept the Mollom privacy policy.