Created
April 10, 2013 17:49
-
-
Save Breefield/5356860 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Show the event map | |
var $map = $('.location-map'); | |
if($map.length) { | |
var approx_location = $map.attr('approx-location'); | |
var approx_city = $map.attr('approx-city'); | |
var location = new google.maps.LatLng( | |
$map.data('latitude'), | |
$map.data('longitude') | |
); | |
var zoom = 15; | |
if(approx_location) zoom = 12; | |
if(approx_city) zoom = 10; | |
var mapOptions = { | |
center: location, | |
zoom: zoom, | |
mapTypeId: google.maps.MapTypeId.ROADMAP, | |
scrollwheel: false, | |
streetViewControl: false, | |
// mapTypeControl: false, | |
zoomControlOptions: { | |
style: google.maps.ZoomControlStyle.SMALL | |
} | |
}; | |
map = new google.maps.Map($map[0], mapOptions); | |
// Location is approximate, show circle | |
if(approx_location || approx_city) { | |
new google.maps.Circle({ | |
center: location, | |
radius: approx_location ? 1500 : 5000, | |
strokeColor: "#F6008C", | |
strokeOpacity: 0.8, | |
strokeWeight: 2, | |
fillColor: "#F6008C", | |
fillOpacity: 0.35, | |
map: map | |
}); | |
// Actual location availible, show that | |
} else { | |
new google.maps.Marker({ | |
map: map, | |
position: location, | |
draggable: false | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment