Running Leaflet Isolated..

811
6
Jump to solution
12-20-2013 07:00 AM
AndrewDavis
New Contributor
Hi..

I have been eyeing the esri-leaflet on GitHub https://github.com/Esri/esri-leaflet  and have been running it on a VM that I have.
The VM is connected to the net and can make connection to ArcGIS online..

I am just starting the investigation of this, and want to know if it would be something I could host locally from my server.

Andy..
0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor
The esri-leaflet library doesn't have any css files, but leaflet does.
This link should work
https://github.com/Leaflet/Leaflet/archive/master.zip

The vendor folder is empty for esri-leaflet unless you need to compile from source. There are instructions on the github page. But the dist folder has everything you need for esri-leaflet except leaflet itself, that's why you need to download that separately.

View solution in original post

0 Kudos
6 Replies
ReneRubalcava
Frequent Contributor
Esri-leaflet does not require any CDN. It's only dependency is Leaflet, which you could download and host directly on your own.
0 Kudos
AndrewDavis
New Contributor
Esri-leaflet does not require any CDN. It's only dependency is Leaflet, which you could download and host directly on your own.


Thanks for the reply...  Happy New Year...

I have the code for leaflet downloaded and hosted on my machines but am still unable to get a map to display with the setup from download.

I'm working on the arcgisbasemap.html example from the leafelet examples.

The first thing I ran into was a lack of the leaflet.css and leaflet.js files.  I downloaded them and put them into the setup for my leaflet and can see that they are working.

Inside the loading of the map.. which looks like the examples are published maps residing on arcgisonline  ..


is this the case?..
0 Kudos
ReneRubalcava
Frequent Contributor
Did you download it as a zipfile off github? The compiled files are in the dist folder.
Here is an example of how I load files for an app where I have the leaflet and esri-leaflet source code in a folder called vendor.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta name='viewport' content='initial-scale=1.0 maximum-scale=1.0'>

<link rel="stylesheet" href="vendor/Leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="vendor/Leaflet.markercluster/dist/MarkerCluster.css" />
<link rel="stylesheet" href="vendor/Leaflet.markercluster/dist/MarkerCluster.Default.css" />
<link rel="stylesheet" href="vendor/leaflet-locatecontrol/src/L.Control.Locate.css" />
<link rel="stylesheet" href="css/styles.css" />

</head>
<body>

<script src="vendor/Leaflet/dist/leaflet-src.js"></script>
<script src="vendor/Leaflet.markercluster/dist/leaflet.markercluster-src.js"></script>
<script src="vendor/leaflet-locatecontrol/src/L.Control.Locate.js"></script>
<script src="vendor/esri-leaflet/dist/esri-leaflet-src.js"></script>
<script src="vendor/esri-leaflet/dist/extras/clustered-feature-layer-src.js"></script>
<script src="bundle.js"></script>

</body>
</html>


Here is the list of dependencies that esri-leaflet uses.
https://github.com/Esri/esri-leaflet#dependencies
But all these are already included in the compiled files in the esri-leaflet/dist folder.
0 Kudos
AndrewDavis
New Contributor
Rene..
Thanks for the reply.  Your sample page is helpful..  my 'dist' folder does not include the .css files.  There are some of the .js files, and the sub-folders inside the 'vendor' folder does not include any files as well.

I think I may have downloaded the wrong Zip from the git hub page.

I used the "download .zip" button on the right side of the page.
0 Kudos
ReneRubalcava
Frequent Contributor
The esri-leaflet library doesn't have any css files, but leaflet does.
This link should work
https://github.com/Leaflet/Leaflet/archive/master.zip

The vendor folder is empty for esri-leaflet unless you need to compile from source. There are instructions on the github page. But the dist folder has everything you need for esri-leaflet except leaflet itself, that's why you need to download that separately.
0 Kudos
AndrewDavis
New Contributor
Thanks..  This seems to be working..


I already clicked the check for the answer you just gave...

Thanks again..
0 Kudos