Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
geojson
<div id="mapid" style="width: 100%; height: 100%; position: relative;"></div>
<script>
var mymap = L.map('mapid').setView([51.505, -0.09], 2);
var myStyle = {
"color": "#ff0000",
"weight": 3,
"opacity": 0.65
};
var geojsonFeature = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"name": "EBBR"
},
"geometry": {
"type": "Point",
"coordinates": [4.49277, 50.8999]
}
}, {
"type": "Feature",
"properties": {
"name": "KOVIN"
},
"geometry": {
"type": "Point",
"coordinates": [3.10639, 49.4858]
}
}, {
"type": "Feature",
"properties": {
"name": "RESMI"
},
"geometry": {
"type": "Point",
"coordinates": [2.19194, 48.5686]
}
}, {
"type": "Feature",
"properties": {
"name": "DEKOD"
},
"geometry": {
"type": "Point",
"coordinates": [2.1, 48.2833]
}
}, {
"type": "Feature",
"properties": {
"name": "DISAK"
},
"geometry": {
"type": "Point",
"coordinates": [2.13167, 48.1333]
}
}, {
"type": "Feature",
"properties": {
"name": "DEPOM"
},
"geometry": {
"type": "Point",
"coordinates": [2.17917, 47.3178]
}
}, {
"type": "Feature",
"properties": {
"name": "CTX"
},
"geometry": {
"type": "Point",
"coordinates": [1.80114, 46.9366]
}
}, {
"type": "Feature",
"properties": {
"name": "GUSON"
},
"geometry": {
"type": "Point",
"coordinates": [1.47778, 46.4742]
}
}, {
"type": "Feature",
"properties": {
"name": "LMG"
},
"geometry": {
"type": "Point",
"coordinates": [1.02558, 45.8159]
}
}, {
"type": "Feature",
"properties": {
"name": "VELIN"
},
"geometry": {
"type": "Point",
"coordinates": [0.15555599999999, 44.98]
}
}, {
"type": "Feature",
"properties": {
"name": "SAU"
},
"geometry": {
"type": "Point",
"coordinates": [-0.152917, 44.6768]
}
}, {
"type": "Feature",
"properties": {
"name": "BEGUY"
},
"geometry": {
"type": "Point",
"coordinates": [-1.45083, 43.0583]
}
}, {
"type": "Feature",
"properties": {
"name": "PPN"
},
"geometry": {
"type": "Point",
"coordinates": [-1.702, 42.7337]
}
}, {
"type": "Feature",
"properties": {
"name": "USADO"
},
"geometry": {
"type": "Point",
"coordinates": [-3.65439, 39]
}
}, {
"type": "Feature",
"properties": {
"name": "GALTO"
},
"geometry": {
"type": "Point",
"coordinates": [-5.14361, 35.8333]
}
}, {
"type": "Feature",
"properties": {
"name": "RBT"
},
"geometry": {
"type": "Point",
"coordinates": [-6.74639, 34.0499]
}
}, {
"type": "Feature",
"properties": {
"name": "SLK"
},
"geometry": {
"type": "Point",
"coordinates": [-7.5061, 33.1157]
}
}, {
"type": "Feature",
"properties": {
"name": "PELAX"
},
"geometry": {
"type": "Point",
"coordinates": [-7.6905, 32.8536]
}
}, {
"type": "Feature",
"properties": {
"name": "MABAP"
},
"geometry": {
"type": "Point",
"coordinates": [-8.19712, 32.1243]
}
}, {
"type": "Feature",
"properties": {
"name": "ADM"
},
"geometry": {
"type": "Point",
"coordinates": [-9.38347, 30.3219]
}
}, {
"type": "Feature",
"properties": {
"name": "MOROX"
},
"geometry": {
"type": "Point",
"coordinates": [-9.95583, 29]
}
}, {
"type": "Feature",
"properties": {
"name": "ECHED"
},
"geometry": {
"type": "Point",
"coordinates": [-10.5167, 27.6667]
}
}, {
"type": "Feature",
"properties": {
"name": "BIMOG"
},
"geometry": {
"type": "Point",
"coordinates": [-11.55, 25.2167]
}
}, {
"type": "Feature",
"properties": {
"name": "ZRT"
},
"geometry": {
"type": "Point",
"coordinates": [-12.4616, 22.7585]
}
}, {
"type": "Feature",
"properties": {
"name": "ARDAR"
},
"geometry": {
"type": "Point",
"coordinates": [-13.0667, 20.5]
}
}, {
"type": "Feature",
"properties": {
"name": "TIMOX"
},
"geometry": {
"type": "Point",
"coordinates": [-13.7936, 17.865]
}
}, {
"type": "Feature",
"properties": {
"name": "NALET"
},
"geometry": {
"type": "Point",
"coordinates": [-13.9078, 17.4478]
}
}, {
"type": "Feature",
"properties": {
"name": "POVIN"
},
"geometry": {
"type": "Point",
"coordinates": [-14.0711, 16.8467]
}
}, {
"type": "Feature",
"properties": {
"name": "VOTAB"
},
"geometry": {
"type": "Point",
"coordinates": [-14.6292, 14.7633]
}
}, {
"type": "Feature",
"properties": {
"name": "ENURI"
},
"geometry": {
"type": "Point",
"coordinates": [-15.0167, 14.7628]
}
}, {
"type": "Feature",
"properties": {
"name": "NURAS"
},
"geometry": {
"type": "Point",
"coordinates": [-15.4842, 14.2222]
}
}, {
"type": "Feature",
"properties": {
"name": "GBYD"
},
"geometry": {
"type": "Point",
"coordinates": [-16.6523, 13.3379]
}
}, {
"type": "Feature",
"properties": [],
"geometry": {
"type": "LineString",
"coordinates": [
[4.49277, 50.8999],
[3.10639, 49.4858],
[2.19194, 48.5686],
[2.1, 48.2833],
[2.13167, 48.1333],
[2.17917, 47.3178],
[1.80114, 46.9366],
[1.47778, 46.4742],
[1.02558, 45.8159],
[0.15555599999999, 44.98],
[-0.152917, 44.6768],
[-1.45083, 43.0583],
[-1.702, 42.7337],
[-3.65439, 39],
[-5.14361, 35.8333],
[-6.74639, 34.0499],
[-7.5061, 33.1157],
[-7.6905, 32.8536],
[-8.19712, 32.1243],
[-9.38347, 30.3219],
[-9.95583, 29],
[-10.5167, 27.6667],
[-11.55, 25.2167],
[-12.4616, 22.7585],
[-13.0667, 20.5],
[-13.7936, 17.865],
[-13.9078, 17.4478],
[-14.0711, 16.8467],
[-14.6292, 14.7633],
[-15.0167, 14.7628],
[-15.4842, 14.2222],
[-16.6523, 13.3379]
]
}
}]
}
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; Esri &mdash; Esri, DeLorme, NAVTEQ - Be noted, this map will get a rework.',
maxZoom: 16
}).addTo(mymap);
L.geoJSON(geojsonFeature, {
style: myStyle
}).addTo(mymap);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment