Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
- <link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
- <!-- <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> -->
- <script src="http://maps-api-tt.appspot.com/apilite/styled/apiv3.js" type="text/javascript"></script>
- <script type="text/javascript">
- var stockholm = new google.maps.LatLng(59.32522, 18.07002);
- var parliament = new google.maps.LatLng(59.327383, 18.06747);
- var map;
- var marker;
- function initialize()
- {
- var mystyle =
- [
- {
- featureType: 'all',
- rules:
- [
- {hue: '#0000ff'},
- {saturation:-75}
- ]
- },
- {
- featureType: 'road.local',
- rules:
- [
- {visibility: 'off'}
- ]
- },
- {
- featureType: 'poi',
- elementType: 'label',
- rules:
- [
- {'visibility': 'off'}
- ]
- }
- ];
- var s = 'Edited';
- var opt =
- {
- mapTypeControlOptions:
- {
- mapTypeIds:
- [
- google.maps.MapTypeId.ROADMAP, s
- ]
- },
- center: stockholm,
- zoom: 14,
- mapTypeId: s
- };
- var mobj = document.getElementById("mymap");
- var map = new google.maps.Map(mobj, opt);
- var styledMapType = new google.maps.StyledMapType(mystyle, {name: s});
- map.mapTypes.set(s, styledMapType);
- marker = new google.maps.Marker({
- map:map,
- draggable:true,
- animation: google.maps.Animation.DROP,
- position: parliament
- });
- google.maps.event.addListener(marker, 'click', toggleBounce);
- }
- function toggleBounce()
- {
- if (marker.getAnimation() != null)
- {
- marker.setAnimation(null);
- }
- else
- {
- marker.setAnimation(google.maps.Animation.BOUNCE);
- }
- }
- </script>
- </head>
- <body onload="initialize()">
- <div id="mymap" style="width: 500px; height: 500px; margin:auto; border: 1px solid gray;"></div>
- </p>
- </body>
- </html>
Add Comment
Please, Sign In to add comment