Leaflet plugin for ArcGIS Feature Services. Esri Leaflet Renderers works in conjunction with the Esri Leaflet Plugin to draw feature services using renderers defined by the service.
Esri Leaflet Renderers is currently in development and should be thought of as a beta or preview.
Take a look at the live demo.
You can also find a side by side comparison of the ArcGIS API for JavaScript here.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Renderer from Service</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<!-- Load Esri Leaflet from CDN -->
<script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet/1.0.0-rc.4/esri-leaflet.js"></script>
<!-- Load Esri Leaflet Renderers -->
<!-- This will hook into Esri Leaflet and draw the predefined Portland Heritage Tree symbols -->
<script src="https://dl.dropboxusercontent.com/u/59331579/0.7.3/esri-leaflet-renderers-0.0.1-beta.1.min.js"></script>
<style>
body {margin:0;padding:0;}
#map {position: absolute;top:0;bottom:0;right:0;left:0;}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map').setView([45.526, -122.667], 13);
L.esri.basemapLayer('Streets').addTo(map);
L.esri.featureLayer('http://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/Heritage_Trees_Portland/FeatureServer/0').addTo(map);
</script>
</body>
</html>
Make sure you have the Grunt CLI installed.
- Fork and clone Esri Leaflet Renderers
cd
into theesri-leaflet-renderers
folder- Install the dependencies with
npm install
- run
grunt
from the command line. This will create minified source, run linting, and start watching the source files for changes. - Make your changes and create a pull request
- Leaflet version 0.7 or higher is required but the latest version is recommended.
- Esri Leaflet - for Esri feature services
Copyright 2014 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's license.txt file.
[](Esri Tags: ArcGIS Web Mapping Leaflet) [](Esri Language: JavaScript)