Leaflet plugin for ArcGIS Feature Services. Esri Leaflet Renderers works in conjunction with the Esri Leaflet Plugin to draw feature services using the defined renderers.
Esri Leaflet Renderers is currently in development and should be thought of as a beta or preview.
Here is a quick example using the Esri Leaflet simple feature layer example. Just change the paths to point to the proper libraries and go. This file can be found in the repo at spec/sample.html.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Simple FeatureLayer</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/0.0.1-beta.5/esri-leaflet.js"></script>
<!-- Load Esri Leaflet Renderers -->
<!-- This will hook into Esri Leaflet and draw the predefined Portland Heritage Tree symbols -->
<script src="../dist/esri-leaflet-renderers.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 start watching the source files and running linting commands. - 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)