-
-
Save AnatoliyKhaulin/547181b0ac0b210678de to your computer and use it in GitHub Desktop.
google map api
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
| <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&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