Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Leaflet.js Tips, Step 2 (getJSON)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<link rel="stylesheet" href="" />
<script src=""></script>
<script src=''></script>
<!-- THIS IS NEW -->
<script src=""></script>
<style type="text/css">
#map {
width: 600px;
height: 400px;
<div id="map"></div>
<script type="text/javascript">
var mapboxTiles = L.tileLayer('https://{s}{z}/{x}/{y}.png', {
attribution: '<a href="" target="_blank">Terms &amp; Feedback</a>'
var map ='map')
.setView([42.444508, -76.499491], 12);
var promise = $.getJSON("businesses.json");
promise.then(function(data) {
//do a bunch of stuff here
console.log(data) // take a look at the data in the console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment