Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Open Street Maps Satellite View</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
- <style>
- @media only screen and (min-width: 600px) {
- body {
- margin-right: 200px;
- margin-left: 200px;
- margin-top: 20px;
- }
- }
- #map {
- height: 100%;
- }
- html,
- body {
- height: 100%;
- margin: 0px;
- }
- </style>
- </head>
- <body>
- <div id="map"> </div>
- </body>
- <script type="text/javascript" src="//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
- <script>
- var mapbox_url = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}';
- var esri_url = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}';
- var esri_attribution = '© Esri © OpenStreetMap Contributors';
- var lyr_satellite = L.tileLayer(esri_url, {id: 'MapID', maxZoom: 20, tileSize: 512, zoomOffset: -1, attribution: esri_attribution});
- var points = [
- {
- "latitude": 25.95618729,
- "longitude": -81.51154125,
- },
- {
- "latitude": 25.95590198,
- "longitude": -81.51149629,
- },
- {
- "latitude": 25.95558575,
- "longitude": -81.51130469,
- },
- {
- "latitude": 25.95714197,
- "longitude": -81.51131631,
- },
- {
- "latitude": 25.95745887,
- "longitude": -81.51090912,
- },
- {
- "latitude": 25.95703306,
- "longitude": -81.51088921,
- },
- {
- "latitude": 25.95711647,
- "longitude": -81.51036314,
- }
- ];
- var markers = [];
- for (i in points) {
- markers.push(L.marker([points[i].latitude, points[i].longitude], {draggable: false}).bindPopup(`<b>Point #${i}</b>`));
- }
- var lg_markers = L.layerGroup(markers);
- //marker = L.marker(['25.95703306', '-81.51088921']);
- var map = L.map('map', {
- center: [25.95618729, -81.51154125],
- zoom: 18,
- layers: [lyr_satellite, lg_markers]
- });
- var baseMaps = {
- "Satellite": lyr_satellite
- };
- var overlayMaps = {
- "Markers": lg_markers,
- };
- L.control.layers(baseMaps, overlayMaps).addTo(map);
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement