Skip to content

Commit f97eb34

Browse files
bmcbrideanshori
authored andcommitted
[Changed] Readme
- Change readme, link demo bootleaf with leaflet 1.3.1
1 parent 80258ff commit f97eb34

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ A simple, responsive template for building web mapping applications with [Bootst
66
### Demo:
77
http://bmcbride.github.io/bootleaf/
88

9+
### Demo Bootleaf with leaflet v.1.3.1:
10+
https://anshori.github.io/bootleaf_1.3.1/
11+
912
### Features:
1013
* Fullscreen mobile-friendly map template with responsive Navbar and modal placeholders
1114
* jQuery loading of external GeoJSON files

assets/js/app.js

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ var cartoLight = L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net
123123
});
124124
var usgsImagery = L.layerGroup([L.tileLayer("http://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/{z}/{y}/{x}", {
125125
maxZoom: 15,
126-
}), L.tileLayer.wms("http://services.nationalmap.gov/arcgis/services/USGSImageOnlyLarge/MapServer/WMSServer?", {
126+
}), L.tileLayer.wms("http://raster.nationalmap.gov/arcgis/services/Orthoimagery/USGS_EROS_Ortho_SCALE/ImageServer/WMSServer?", {
127127
minZoom: 16,
128-
layers: "2",
129-
format: 'image/png',
128+
maxZoom: 19,
129+
layers: "0",
130+
format: 'image/jpeg',
130131
transparent: true,
131132
attribution: "Aerial Imagery courtesy USGS"
132133
})]);
@@ -140,7 +141,27 @@ var highlightStyle = {
140141
radius: 10
141142
};
142143

144+
/* Single marker cluster layer to hold all clusters */
145+
var markerClusters = new L.MarkerClusterGroup({
146+
spiderfyOnMaxZoom: true,
147+
showCoverageOnHover: false,
148+
zoomToBoundsOnClick: true,
149+
disableClusteringAtZoom: 16
150+
});
151+
152+
/* Map Center */
153+
map = L.map("map", {
154+
zoom: 10,
155+
center: [40.702222, -73.979378],
156+
layers: [cartoLight, markerClusters, highlight],
157+
zoomControl: false,
158+
attributionControl: false
159+
});
160+
161+
map.createPane("pane_boroughs");
162+
map.getPane("pane_boroughs").style.zIndex = 402;
143163
var boroughs = L.geoJson(null, {
164+
pane: "pane_boroughs",
144165
style: function (feature) {
145166
return {
146167
color: "black",
@@ -160,6 +181,7 @@ var boroughs = L.geoJson(null, {
160181
});
161182
$.getJSON("data/boroughs.geojson", function (data) {
162183
boroughs.addData(data);
184+
map.addLayer(boroughs);
163185
});
164186

165187
//Create a color dictionary based off of subway route_id
@@ -170,7 +192,10 @@ var subwayColors = {"1":"#ff3135", "2":"#ff3135", "3":"ff3135", "4":"#009b2e",
170192
"GS":"#6e6e6e", "J":"#976900", "Z":"#976900", "L":"#969696", "N":"#ffff00",
171193
"Q":"#ffff00", "R":"#ffff00" };
172194

195+
map.createPane("pane_subwayLines");
196+
map.getPane("pane_subwayLines").style.zIndex = 401;
173197
var subwayLines = L.geoJson(null, {
198+
pane: "pane_subwayLines",
174199
style: function (feature) {
175200
return {
176201
color: subwayColors[feature.properties.route_id],
@@ -212,14 +237,6 @@ $.getJSON("data/subways.geojson", function (data) {
212237
subwayLines.addData(data);
213238
});
214239

215-
/* Single marker cluster layer to hold all clusters */
216-
var markerClusters = new L.MarkerClusterGroup({
217-
spiderfyOnMaxZoom: true,
218-
showCoverageOnHover: false,
219-
zoomToBoundsOnClick: true,
220-
disableClusteringAtZoom: 16
221-
});
222-
223240
/* Empty layer placeholder to add to layer control for listening when to add/remove theaters to markerClusters layer */
224241
var theaterLayer = L.geoJson(null);
225242
var theaters = L.geoJson(null, {
@@ -305,14 +322,6 @@ $.getJSON("data/DOITT_MUSEUM_01_13SEPT2010.geojson", function (data) {
305322
museums.addData(data);
306323
});
307324

308-
map = L.map("map", {
309-
zoom: 10,
310-
center: [40.702222, -73.979378],
311-
layers: [cartoLight, boroughs, markerClusters, highlight],
312-
zoomControl: false,
313-
attributionControl: false
314-
});
315-
316325
/* Layer control listeners that allow for a single markerClusters layer */
317326
map.on("overlayadd", function(e) {
318327
if (e.layer === theaterLayer) {

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<title>BootLeaf</title>
1313

1414
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
15-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
16-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css">
17-
<link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.css">
18-
<link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/MarkerCluster.Default.css">
15+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
16+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css">
17+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.3.0/MarkerCluster.css">
18+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.3.0/MarkerCluster.Default.css">
1919
<link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.43.0/L.Control.Locate.css">
2020
<link rel="stylesheet" href="assets/leaflet-groupedlayercontrol/leaflet.groupedlayercontrol.css">
2121
<link rel="stylesheet" href="assets/css/app.css">
@@ -292,8 +292,8 @@ <h4 class="modal-title">
292292
<script src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.10.5/typeahead.bundle.min.js"></script>
293293
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js"></script>
294294
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
295-
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.js"></script>
296-
<script src="https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-markercluster/v0.4.0/leaflet.markercluster.js"></script>
295+
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js"></script>
296+
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.3.0/leaflet.markercluster.js"></script>
297297
<script src="https://api.tiles.mapbox.com/mapbox.js/plugins/leaflet-locatecontrol/v0.43.0/L.Control.Locate.min.js"></script>
298298
<script src="assets/leaflet-groupedlayercontrol/leaflet.groupedlayercontrol.js"></script>
299299
<script src="assets/js/app.js"></script>

0 commit comments

Comments
 (0)