aboutsummaryrefslogtreecommitdiff
path: root/examples/index.html
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2015-03-08 19:31:41 +0000
committerChristopher Baines <mail@cbaines.net>2015-03-08 19:31:41 +0000
commitad7e8ab707826935cac7220258c416367b96e1ed (patch)
treebd358ff58d8af4af0c87be9d3945328c8ecab31c /examples/index.html
parent9deee4b61312ba80e63ef7d769640e8f3cc89653 (diff)
downloadleaflet-indoor-ad7e8ab707826935cac7220258c416367b96e1ed.tar
leaflet-indoor-ad7e8ab707826935cac7220258c416367b96e1ed.tar.gz
Change the example to use data from a file
This is instead of using the OverpassAPI query. That example has been moved to examples/live
Diffstat (limited to 'examples/index.html')
-rw-r--r--examples/index.html21
1 files changed, 6 insertions, 15 deletions
diff --git a/examples/index.html b/examples/index.html
index b5a5a5a..9dcc2cf 100644
--- a/examples/index.html
+++ b/examples/index.html
@@ -34,7 +34,6 @@
<script src="jquery.min.js"></script>
<script src="leaflet-src.js"></script>
<script src="../leaflet-indoor.js"></script>
- <script src="osmtogeojson.js"></script>
<script type="text/JavaScript">
// Create the map
@@ -50,20 +49,12 @@
zoom: 19
});
- // This example uses OpenStreetMap data, fetched from the OverpassAPI,
- // note however that leaflet-indoor does not fetch any data.
- //
- // 1370729 is the OSM ID for the relation of the building used in this
- // example, it can be viewed online here:
- // http://www.openstreetmap.org/relation/1370729
- var query = '(relation(1370729);>>->.rels;>;);out;';
-
- $.get("//overpass-api.de/api/interpreter?data=" + query, function(data) {
- var geoJSON = osmtogeojson(data, {
- polygonFeatures: {
- buildingpart: true
- }
- });
+ // This example uses a GeoJSON FeatureCollection saved to a file
+ // (data.json), see the other example (live/index.html) for details on
+ // fetching data using the OverpassAPI (this is also how the data in
+ // data.json was generated)
+
+ $.getJSON("data.json", function(geoJSON) {
var indoorLayer = new L.Indoor(geoJSON, {
getLevel: function(feature) {