Guest User

Untitled

a guest
Jan 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  5. <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  6. <title>Google Maps JavaScript API v3 Example: KmlLayer KML</title>
  7. <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
  8. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  9. <script type="text/javascript">
  10. $(document).ready(function(){
  11. $(".b_opacity").click(function(){
  12. //this will find all the images in the map canvas container. Normally you would want to target specific images by the value of src
  13. $("#map_canvas").find("img").css("opacity","0.4")
  14.  
  15. })
  16. })
  17.  
  18.  
  19. function initialize() {
  20. var chicago = new google.maps.LatLng(41.875696,-87.624207);
  21. var myOptions = {
  22. zoom: 11,
  23. center: chicago,
  24. mapTypeId: google.maps.MapTypeId.ROADMAP
  25. }
  26.  
  27. var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  28.  
  29. var ctaLayer = new google.maps.KmlLayer('http://code.google.com/apis/kml/documentation/KML_Samples.kml');
  30. ctaLayer.setMap(map);
  31. }
  32. </script>
  33. </head>
  34. <body onload="initialize()">
  35.  
  36. <div id="map_canvas" style="width: 600px;height: 600px;"></div>
  37. <input type="button" value="dim the lights" class="b_opacity">
  38. </body>
  39. </html>
  40.  
  41. #map > div > div > div > div > div:nth-child(2) img[draggable="false"] {
  42. opacity: 0.4;
  43. }
Add Comment
Please, Sign In to add comment