Skip to content

Instantly share code, notes, and snippets.

@ngottlieb
ngottlieb / map.js
Last active November 22, 2018 22:40
Loading external GeoJSON with Leaflet-Ajax
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,