Show Script
<!-- Gmaps js
============================================ -->
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<!-- Gmaps.js - Custom Controls -->
<script type="text/javascript">
var map;
$(document).ready(function(){
map = new GMaps({
el: '#map-4',
zoom: 16,
lat: 51.49904072281125,
lng: -0.0390625,
zoom: 5
});
map.addControl({
position: 'top_right',
content: 'Geolocate',
style: {
margin: '5px',
padding: '1px 6px',
border: 'solid 1px #717B87',
background: '#fff'
},
events: {
click: function(){
GMaps.geolocate({
success: function(position){
map.setCenter(position.coords.latitude, position.coords.longitude);
},
error: function(error){
alert('Geolocation failed: ' + error.message);
},
not_supported: function(){
alert("Your browser does not support geolocation");
}
});
}
}
});
});
</script>