JAVASCRIPT   26
Google maps
Guest on 27th August 2023 11:58:46 AM


  1. google.maps.event.addDomListener(window, 'load', init);
  2.  
  3. var map;
  4.  
  5. function init() {
  6.         var mapOptions = {
  7.                 center: new google.maps.LatLng(29.7063428,-95.40526,17),
  8.                 zoom: 17,
  9.                 zoomControl: true,
  10.                 zoomControlOptions: {
  11.                         style: google.maps.ZoomControlStyle.SMALL,
  12.                 },
  13.                 disableDoubleClickZoom: true,
  14.                 mapTypeControl: true,
  15.                 mapTypeControlOptions: {
  16.                         style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
  17.                 },
  18.                 scaleControl: false,
  19.                 scrollwheel: true,
  20.                 streetViewControl: true,
  21.                 draggable : true,
  22.                 overviewMapControl: false,
  23.                 mapTypeId: google.maps.MapTypeId.ROADMAP,
  24.                 styles: [
  25.                 {
  26.                         featureType: "landscape",
  27.                         stylers: [
  28.                         { saturation: -100 },
  29.                         { lightness: 65 },
  30.                         { visibility: "on" }
  31.                         ]
  32.                 },{
  33.                         featureType: "poi",
  34.                         stylers: [
  35.                         { saturation: -100 },
  36.                         { lightness: 51 },
  37.                         { visibility: "simplified" }
  38.                         ]
  39.                 },{
  40.                         featureType: "road.highway",
  41.                         stylers: [
  42.                         { saturation: -100 },
  43.                         { visibility: "simplified" }
  44.                         ]
  45.                 },{
  46.                         featureType: "road.arterial",
  47.                         stylers: [
  48.                         { saturation: -100 },
  49.                         { lightness: 30 },
  50.                         { visibility: "on" }
  51.                         ]
  52.                 },{
  53.                         featureType: "road.local",
  54.                         stylers: [
  55.                         { saturation: -100 },
  56.                         { lightness: 40 },
  57.                         { visibility: "on" }
  58.                         ]
  59.                 },{
  60.                         featureType: "transit",
  61.                         stylers: [
  62.                         { saturation: -100 },
  63.                         { visibility: "simplified" }
  64.                         ]
  65.                 },{
  66.                         featureType: "administrative.province",
  67.                         stylers: [
  68.                         { visibility: "off" }
  69.                         ]
  70.         /** /
  71.                 },{
  72.                         featureType: "administrative.locality",
  73.                         stylers: [
  74.                                 { visibility: "off" }
  75.                         ]
  76.                 },{
  77.                         featureType: "administrative.neighborhood",
  78.                         stylers: [
  79.                                 { visibility: "on" }
  80.                         ]
  81.                         /**/
  82.                 },{
  83.                         featureType: "water",
  84.                         elementType: "labels",
  85.                         stylers: [
  86.                         { visibility: "on" },
  87.                         { lightness: -25 },
  88.                         { saturation: -100 }
  89.                         ]
  90.                 },{
  91.                         featureType: "water",
  92.                         elementType: "geometry",
  93.                         stylers: [
  94.                         { hue: "#ffff00" },
  95.                         { lightness: -25 },
  96.                         { saturation: -97 }
  97.                         ]
  98.                 }
  99.                 ],
  100.                
  101.         }
  102.  
  103.         var mapElement = document.getElementById('map');
  104.         var map = new google.maps.Map(mapElement, mapOptions);
  105.         var locations = [
  106.        
  107.         ];
  108.  
  109.         for (i = 0; i < locations.length; i++) {
  110.                 marker = new google.maps.Marker({
  111.                         icon: '',
  112.                         position: new google.maps.LatLng(locations[i][1], locations[i][2]),
  113.                         map: map
  114.                 });
  115.         }
  116. }

Raw Paste

Login or Register to edit or fork this paste. It's free.