Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
<link rel="stylesheet" href=""/>
<script src=""></script>
<script src=""></script>
<script src="leaflet-providers.js"></script>
<div id="map" style="width: 100%; height: 300px;"></div>
<script type="text/javascript">
var map ='map');
var terrainTiles = L.tileLayer.provider('OpenTopoMap');
map.setView([35.9908385, -78.9005222], 3);
function addDataToMap(data, map) {
var dataLayer = L.geoJson(data, {
onEachFeature: function(feature, layer) {
var popupText = "Magnitude: " +
+ "<br>Location: " +
+ "<br><a href='" + + "'>More info</a>";
layer.bindPopup(popupText); }
$.getJSON("", function(data) { addDataToMap(data, map); });

sorry,can you help me on this case.i have geojson imported in the map but i want apply different markericon on each.
so can you please explain to me

Is there any way to link to a JSON as a file? So that you could change the data if you wanted to? I've tried several methods that haven't worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment