@@ -123,10 +123,11 @@ var cartoLight = L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net
123123} ) ;
124124var 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 ;
143163var 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 ;
173197var 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 */
224241var theaterLayer = L . geoJson ( null ) ;
225242var 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 */
317326map . on ( "overlayadd" , function ( e ) {
318327 if ( e . layer === theaterLayer ) {
0 commit comments