Skip to content

Instantly share code, notes, and snippets.

@ngottlieb
ngottlieb / map.js
Last active Nov 22, 2018
Loading external GeoJSON with Leaflet-Ajax
View map.js
import L from 'leaflet';
require("leaflet-ajax");
export default class Map {
constructor(props) {
this.map = L.map('mapid').setView([42, -100], 4);
// see here for other tileLayer providers:
// https://leaflet-extras.github.io/leaflet-providers
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,