Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if( $('#map2').length > 0) {
var map2 = $('#map2'),
map_lat2 = map2.data('lat'),
map_ing2 = map2.data('ing');
// init the map and create a cluster with some markers
$('#map2').gmap3({
map:{
options:{
center:[map_lat2,map_ing2],
zoom: 14,
panControl: false,
overviewMapControl: false,
mapTypeControl: false,
scaleControl: true,
scrollwheel: false,
streetViewControl: false,
zoomControl: true,
maxZoom: 17,
minZoom: 10
}
},
marker:{
latLng:[map_lat2,map_ing2]
},
});
// esto tiene que venir de custom fields
var neighborhood2 = 'Wattle Glen, Diamond Creek, Victoria 3089';
$("#map2").gmap3({
getroute: {
options: {
origin: neighborhood2,
destination: '10/331 Diamond Creek Road Diamond Creek VIC 3089',
travelMode: google.maps.DirectionsTravelMode.DRIVING
},
callback: function(results){
if (!results) return;
$(this).gmap3({
map:{
options:{
zoom: 6,
center: [-37.677511, 145.127850]
}
},
directionsrenderer:{
//container: $(document.createElement("div")).addClass("googlemap").insertAfter($("#map")),
options:{
directions:results
}
}
});
}
}
});
}//map2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment