File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ var constants = {
1717 _googleAnalytics : 'Google Analytics Tracking ID' ,
1818 // Map Settings
1919 _tileProvider : 'Basemap Tiles' ,
20+ _tileProviderApiKey : 'Basemap Tiles API Key' ,
2021 _markercluster : 'Cluster Markers' ,
2122 _introPopupText : 'Intro Popup Text' ,
2223 _initZoom : 'Initial Zoom' ,
Original file line number Diff line number Diff line change @@ -926,13 +926,23 @@ $(window).on('load', function() {
926926 * Loads the basemap and adds it to the map
927927 */
928928 function addBaseMap ( ) {
929+
929930 var basemap = trySetting ( '_tileProvider' , 'CartoDB.Positron' ) ;
931+
930932 L . tileLayer . provider ( basemap , {
931- maxZoom : 18
933+ maxZoom : 18 ,
934+
935+ // Pass the api key to most commonly used parameters
936+ apiKey : trySetting ( '_tileProviderApiKey' , '' ) ,
937+ apikey : trySetting ( '_tileProviderApiKey' , '' ) ,
938+ key : trySetting ( '_tileProviderApiKey' , '' ) ,
939+ accessToken : trySetting ( '_tileProviderApiKey' , '' )
932940 } ) . addTo ( map ) ;
941+
933942 L . control . attribution ( {
934943 position : trySetting ( '_mapAttribution' , 'bottomright' )
935944 } ) . addTo ( map ) ;
945+
936946 }
937947
938948 /**
You can’t perform that action at this time.
0 commit comments