Skip to content

Instantly share code, notes, and snippets.

@AnatoliyKhaulin
Last active December 23, 2015 08:45
Show Gist options
  • Select an option

  • Save AnatoliyKhaulin/547181b0ac0b210678de to your computer and use it in GitHub Desktop.

Select an option

Save AnatoliyKhaulin/547181b0ac0b210678de to your computer and use it in GitHub Desktop.
google map api
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"></script>
function initialize() {
// disable drag in small device
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var isDraggable = w > 480 ? true : false;
var mapOptions = {
draggable: isDraggable,
scrollwheel: false
};
// disable touch device
var isDraggable = !('ontouchstart' in document.documentElement);
var mapOptions = {
draggable: isDraggable,
scrollwheel: false
};
var mapOptions = {
zoom: 15,
center: new google.maps.LatLng(59.9992618,30.3648466)
}
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
// var image = "http://i.neoseeker.com/mgv/499846/846/33/15847_179440563793_179437393793_2772323_4548598_n_icon.jpg";
var myLatLng = new google.maps.LatLng(59.999,30.364);
var beachMarker = new google.maps.Marker({
position: myLatLng,
map: map,
// icon: image
});
}
google.maps.event.addDomListener(window, 'load', initialize);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment