2017 © Pedro Peláez
 

silverstripe-module silverstripe-widget-googlemap

A simple, non-bloated, google maps SilverStripe widget.

image

burnbright/silverstripe-widget-googlemap

A simple, non-bloated, google maps SilverStripe widget.

  • Wednesday, January 13, 2016
  • by jedateach
  • Repository
  • 1 Watchers
  • 0 Stars
  • 86 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Google Maps Widget

A google map widget for SilverStripe. This widget has intentially been made simple, leaving out any bloat., (*1)

CMS options include:, (*2)

  • Latitude / Longitude
  • Zoom Level
  • Disable Controls

Customising the map

You can customise the map via javascript, by accessing stored references to each map, found in the global variable GoogleMapWidget.maps., (*3)

For example, to style all maps grey, pan left 200px, and add a custom marker:, (*4)

(function($) {
    $(document).ready(function() {
        if(typeof GoogleMapWidget != 'undefined'){ //if widget is present
            var style = [
                {
                    "stylers": [
                        { "saturation": -100}
                    ]
                }
            ];
            var customMapType = new google.maps.StyledMapType(style);
            var map;
            for (var i in GoogleMapWidget.maps) {
                map = GoogleMapWidget.maps[i]
                map.mapTypes.set("STYLED_MAP", customMapType);
                map.setOptions({
                    mapTypeId: "STYLED_MAP"
                });
                map.panBy(200,0);
                map.marker.setIcon("mysite/images/map_marker.png");
            };
        }
    });
})(jQuery);

Create a custom map styles here: http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html, (*5)

The Versions

13/01 2016

dev-master

9999999-dev

A simple, non-bloated, google maps SilverStripe widget.

  Sources   Download

BSD-2-Clause

The Requires

 

google map