2

We've been using esri-leaflet to put a base layer on my maps, but now we want a different look. Using their webmap editor we have put together a map we like and I have the webmap ID and using the docs I thought I could just use webMap the same way I used basemaplayer, but it turns out that webmap is an extra library, only reached 0.4 and hasn't been updated in a long time.

Question: Is there a way to use the tiles/basemap from an Esri webmap using Leaflet and esri-leaflet?

And if not, how to I import esri-leaflet-webmap because import {webmap} from 'esri-leaflet-webmap'; results in Cannot find module 'esri-leaflet-webmap' or its corresponding type declarations. even though it is there in node_modules just like esri-leaflet

Old code

import * as L from 'leaflet'; 
import * as esri from 'esri-leaflet';

…

this.map = L.map(this.mapContainer.nativeElement, {});
esri.basemapLayer('Imagery').addTo(this.map);

New code

esri.webMap(webmapId).addTo(this.map);
Craig
  • 8,093
  • 8
  • 42
  • 74

0 Answers0