Skip to content

Commit 7310bd1

Browse files
committed
updated readme to link to quick start code
instead of including it inline
1 parent d09bfe4 commit 7310bd1

File tree

2 files changed

+6
-46
lines changed

2 files changed

+6
-46
lines changed

README.md

+6-46
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Support for [Geocoding](https://github.com/Esri/esri-leaflet-geocoder) services
2626

2727
- [Getting Started](#getting-started)
2828
- [Demos](#demos)
29-
- [Example](#example)
29+
- [Quick Start](#quick-start)
3030
- [API Reference](#api-reference)
3131
- [Additional Plugins](#additional-plugins)
3232
- [Frequently Asked Questions](#frequently-asked-questions)
@@ -45,51 +45,11 @@ We've shared lots of sample code showing off many of the features of Esri Leafle
4545

4646
http://esri.github.io/esri-leaflet/examples/
4747

48-
## Example
49-
The easiest way to get started is to load Esri Leaflet via [CDN](https://unpkg.com/esri-leaflet). Here is an example you can copy/paste into your own `.html` file.
50-
51-
![App](https://raw.github.com/Esri/esri-leaflet/master/example.png)
52-
53-
```html
54-
<!DOCTYPE html>
55-
<html>
56-
<head>
57-
<!-- Load Leaflet from CDN -->
58-
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css"/>
59-
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
60-
61-
<!-- Load Esri Leaflet from CDN -->
62-
<script src="https://unpkg.com/esri-leaflet/dist/esri-leaflet.js"></script>
63-
64-
<style>
65-
html, body, #map {
66-
margin:0; padding:0; width : 100%; height : 100%;
67-
}
68-
</style>
69-
</head>
70-
<body>
71-
<div id="map"></div>
72-
<script>
73-
const map = L.map('map').setView([34.39, -117.189], 6);
74-
L.esri.basemapLayer("Gray").addTo(map);
75-
76-
// https://www.arcgis.com/home/item.html?id=c8d60ffcbf5c4030a17762fe10e81c6a
77-
const parks = L.esri.featureLayer({
78-
url: "https://services1.arcgis.com/fBc8EJBxQRMcHlei/ArcGIS/rest/services/NPS_Land_Resources_Division_Boundary_and_Tract_Data_Service/FeatureServer/2",
79-
style: function () {
80-
return { color: "#70ca49", weight: 2 };
81-
}
82-
}).addTo(map);
83-
84-
const popupTemplate = "<h3>{UNIT_NAME}</h3><p>Type: {UNIT_TYPE}</p><p>Region: {REGION}</p>";
85-
86-
parks.bindPopup(function(e){
87-
return L.Util.template(popupTemplate, e.feature.properties)
88-
});
89-
</script>
90-
</body>
91-
</html>
92-
```
48+
## Quick Start
49+
The easiest way to get started is to load Esri Leaflet via [CDN](https://unpkg.com/esri-leaflet). Here is an example you can copy/paste into your own `.html` file: [Esri Leaflet Quick Start](https://esri.github.io/esri-leaflet/examples/)
50+
51+
[![App](https://raw.github.com/Esri/esri-leaflet/master/example.png)](https://esri.github.io/esri-leaflet/examples/)
52+
9353

9454
## [API Reference](http://esri.github.io/esri-leaflet/api-reference/)
9555

example.png

471 KB
Loading

0 commit comments

Comments
 (0)