Skip to content

Instantly share code, notes, and snippets.

@fuadarradhi
Forked from ThomasG77/countries.geojson
Created September 19, 2023 07:33
Show Gist options
  • Save fuadarradhi/b5af9007431fafe55189b63c3d4cb346 to your computer and use it in GitHub Desktop.
Save fuadarradhi/b5af9007431fafe55189b63c3d4cb346 to your computer and use it in GitHub Desktop.

Revisions

  1. @ThomasG77 ThomasG77 revised this gist Nov 17, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    <html>
    <head>
    <title>A Leaflet map!</title>
    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
    <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="" />
    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
    <style>
    #map{ height: 100% }
    </style>
  2. @ThomasG77 ThomasG77 revised this gist Nov 17, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@
    <title>A Leaflet map!</title>
    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
    <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
    <style>
    #map{ height: 100% }
    </style>
    @@ -26,7 +25,7 @@
    }).addTo(map);

    // load GeoJSON from an external file
    $.getJSON("countries.geojson",function(data){
    fetch("countries.geojson").then(res => res.json()).then(data => {
    // add GeoJSON layer to the map once the file is loaded
    L.geoJson(data).addTo(map);
    });
  3. @ThomasG77 ThomasG77 created this gist Jul 23, 2015.
    358 changes: 358 additions & 0 deletions countries.geojson
    358 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
    36 changes: 36 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    <html>
    <head>
    <title>A Leaflet map!</title>
    <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
    <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
    <style>
    #map{ height: 100% }
    </style>
    </head>
    <body>

    <div id="map"></div>

    <script>

    // initialize the map
    var map = L.map('map').setView([42.35, -71.08], 3);

    // load a tile layer
    L.tileLayer('http://tiles.mapc.org/basemap/{z}/{x}/{y}.png',
    {
    attribution: 'Tiles by <a href="http://mapc.org">MAPC</a>, Data by <a href="http://mass.gov/mgis">MassGIS</a>',
    maxZoom: 17,
    minZoom: 9
    }).addTo(map);

    // load GeoJSON from an external file
    $.getJSON("countries.geojson",function(data){
    // add GeoJSON layer to the map once the file is loaded
    L.geoJson(data).addTo(map);
    });

    </script>
    </body>
    </html>