Casimiro Buendia: Difference between revisions

From Wiki Malolos
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== Polygon Test ==


<mapframe width=400 height=300 zoom=15 latitude=40.7664 longitude=-73.9680>
<!-- Map container -->
{
<div id="map" style="height: 500px;"></div>
  "type": "FeatureCollection",
 
  "features": [
<!-- Load Leaflet -->
    {
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
      "type": "Feature",
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
      "geometry": {
 
        "type": "Polygon",
<!-- Initialize the map -->
        "coordinates": [[
<script>
          [-73.9712, 40.7644],
  var map = L.map('map').setView([48.8584, 2.2945], 13); // Example: Eiffel Tower
          [-73.9712, 40.7684],
 
          [-73.9654, 40.7684],
  L.tileLayer('https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=Y2PXAZcKI4qY0zpEUqOi', {
          [-73.9654, 40.7644],
    tileSize: 512,
          [-73.9712, 40.7644]
    zoomOffset: -1,
        ]]
    attribution: '&copy; <a href="https://www.maptiler.com/copyright/">MapTiler</a> & <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
      },
  }).addTo(map);
      "properties": {
 
        "title": "Central Park Sample",
  // Optional marker
        "description": "A small polygon near Central Park.",
   L.marker([48.8584, 2.2945]).addTo(map)
        "stroke": "#ff0000",
    .bindPopup('Eiffel Tower')
        "stroke-width": 2,
    .openPopup();
        "fill": "#ffa500",
</script>
        "fill-opacity": 0.4
      }
    }
   ]
}
</mapframe>

Revision as of 00:31, 13 May 2025

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" /> <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>

<script>

 var map = L.map('map').setView([48.8584, 2.2945], 13); // Example: Eiffel Tower
 L.tileLayer('https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=Y2PXAZcKI4qY0zpEUqOi', {
   tileSize: 512,
   zoomOffset: -1,
   attribution: '© <a href="https://www.maptiler.com/copyright/">MapTiler</a> & <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
 }).addTo(map);
 // Optional marker
 L.marker([48.8584, 2.2945]).addTo(map)
   .bindPopup('Eiffel Tower')
   .openPopup();

</script>