Coder Social home page Coder Social logo

helpfulrobot / burnbright-silverstripe-widget-googlemap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from burnbright/silverstripe-widget-googlemap

0.0 2.0 0.0 6 KB

Google map widget for SilverStripe

License: BSD 2-Clause "Simplified" License

JavaScript 30.59% PHP 66.70% Scheme 2.71%

burnbright-silverstripe-widget-googlemap's Introduction

Google Maps Widget

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

CMS options include:

  • 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.

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

(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

burnbright-silverstripe-widget-googlemap's People

Contributors

jedateach avatar

Watchers

James Cloos avatar helpfulrobot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.