
Upgrade Your Drupal Skills
We trained 1,000+ Drupal Developers over the last decade.
See Advanced Courses NAH, I know EnoughDynamic 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:
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.
About Drupal Sun
Drupal Sun is an Evolving Web project. It allows you to:
- Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
- Facet based on tags, author, or feed
- Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
- View the entire article text inline, or in the context of the site where it was created
See the blog post at Evolving Web