Skip to content

Instantly share code, notes, and snippets.

@leepfrog
Created May 16, 2013 00:57
Show Gist options
  • Select an option

  • Save leepfrog/5588650 to your computer and use it in GitHub Desktop.

Select an option

Save leepfrog/5588650 to your computer and use it in GitHub Desktop.
Google maps stuff
$(document).ready ->
if $("#contact-head").length
mochaleaf = new google.maps.LatLng(37.777901,-122.411996)
image = '/assets/ml.map.png'
mochaStyles = [
featureType: "administrative"
elementType: "geometry"
stylers: [ visibility: "off" ]
,
featureType: "poi"
elementType: "labels"
stylers: [ visibility: "off" ]
,
featureType: "road.highway"
elementType: "labels"
stylers: [ visibility: "simplified" ]
,
featureType: "landscape"
stylers: [
hue: "#FFE1A2"
,
saturation: 70
,
visibility: "simplified"
]
,
featureType: "road"
stylers: [
hue: "#679146"
,
saturation: -75
]
]
mochaMapType = new google.maps.StyledMapType mochaStyles,
name: "MochaMap"
map = new google.maps.Map document.getElementById('contact-head'),
center: mochaleaf
zoom: 17
scrollwheel: false
navigationControl: false
mapTypeControl: false
scaleControl: false
draggable: false
mapTypeControlOptions:
mapTypeIds: [google.maps.MapTypeId.ROADMAP, "MochaMap"]
marker = new google.maps.Marker
position: mochaleaf
map: map
title: "MochaLeaf, Inc"
icon: image
map.mapTypes.set 'MochaMap', mochaMapType
map.setMapTypeId 'MochaMap'
$(window).resize ->
map.setOptions center: mochaleaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment