Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Parcheggi Festa della Fragola</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
- <meta charset="utf-8">
- <style>
- /* Always set the map height explicitly to define the size of the div
- * element that contains the map. */
- #map {
- height: 100%;
- }
- /* Optional: Makes the sample page fill the window. */
- html, body {
- height: 100%;
- margin: 0;
- padding: 0;
- }
- </style>
- </head>
- <body>
- <div id="map"></div>
- <script>
- var map;
- function initMap() {
- map = new google.maps.Map(document.getElementById('map'), {
- zoom: 15,
- center: new google.maps.LatLng(45.570058, 11.932437),
- mapTypeId: 'roadmap'
- });
- var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/';
- var icons = {
- parking: {
- icon: 'parking_lot_maps.png' /*iconBase + 'parking_lot_maps.png'*/
- },
- library: {
- icon: iconBase + 'library_maps.png'
- },
- info: {
- icon: iconBase + 'info-i_maps.png'
- },
- verde: {icon: 'verde.png'},
- giallo: {icon: 'giallo.png'},
- rosso: {icon: 'rosso.png'},
- };
- var features = [
- {
- position: new google.maps.LatLng(45.566517, 11.937161),
- type: 'giallo', label: 'P1',
- },
- {
- position: new google.maps.LatLng(45.568067, 11.934739),
- type: 'rosso', label: 'P2',
- },
- {
- position: new google.maps.LatLng(45.566107, 11.931922),
- type: 'giallo', label: 'P3',
- },
- {
- position: new google.maps.LatLng(45.565401, 11.931939),
- type: 'rosso', label: 'P4',
- },
- {
- position: new google.maps.LatLng(45.568165, 11.928356),
- type: 'giallo', label: 'P5',
- },
- {
- position: new google.maps.LatLng(45.569585, 11.927449),
- type: 'verde', label: 'P6',
- },
- {
- position: new google.maps.LatLng(45.570599, 11.929563),
- type: 'rosso', label: 'P7',
- },
- {
- position: new google.maps.LatLng(45.571593, 11.937362),
- type: 'verde', label: 'P8',
- },
- {
- position: new google.maps.LatLng(45.572769, 11.936571),
- type: 'giallo', label: 'P9',
- },
- {
- position: new google.maps.LatLng(45.570467, 11.938746),
- type: 'verde', label: 'P10',
- },
- {
- position: new google.maps.LatLng(45.574234, 11.937247),
- type: 'rosso', label: 'P11',
- },
- {
- position: new google.maps.LatLng(45.566224, 11.928683),
- type: 'verde', label: 'P12',
- },
- ];
- // Create markers.
- features.forEach(function(feature) {
- var marker = new google.maps.Marker({
- position: feature.position,
- icon: icons[feature.type].icon,
- map: map,
- label: {text: feature.label, color: "black"},
- });
- });
- }
- </script>
- <script async defer
- src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB4tHxdtESGK0HBuHGkbxpDkxk1tmcujB4&callback=initMap">
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment