Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewkolesnikov/595717 to your computer and use it in GitHub Desktop.
Save andrewkolesnikov/595717 to your computer and use it in GitHub Desktop.
:coffeescript
ready_handler = ->
if GBrowserIsCompatible
map = new GMap2 document.getElementById "map"
map.setCenter new GLatLng(37.4419, -122.1419), 13
mapTypes = new GMapTypeControl
map.addControl mapTypes
map.addMapType G_PHYSICAL_MAP
map.removeMapType G_SATELLITE_MAP
map.addControl new GSmallZoomControl
map.setMapType G_PHYSICAL_MAP
geocoder = new GClientGeocoder
geocoder.getLatLng "215 First st, Cambridge, MA", geoCallback
$ ready_handler
geoCallback = (point) ->
if !point
alert address + " not found"
else
map.setCenter point, 15
baseIcon = new GIcon "/dt.png"
baseIcon.shadow = "/t_shadow.png"
baseIcon.iconSize = new GSize 85, 28
baseIcon.shadowSize = new GSize 30, 19
baseIcon.iconAnchor = new GPoint 11, 14
baseIcon.infoWindowAnchor = new GPoint 16, 10
HGIcon = new GIcon baseIcon
HGIcon.image = "/st.png"
markerOptions = { icon:HGIcon }
marker = new GMarker point, markerOptions
map.addOverlay marker
VideoJS.setupAllWhenReady()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment