Skip to content

Commit

Permalink
Fix up protcols for OSM/Stamen layers and make sure not to emit geojs…
Browse files Browse the repository at this point in the history
…on-vt setup code for leaflet
  • Loading branch information
jumpinjackie committed Nov 12, 2021
1 parent f28e1fd commit 87bb736
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Maestro.MapPublisher.Common/GeoJSONDataDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ private async Task<DownloadedFeaturesRef> DownloadFromLayerDefinitionAsync(int l
// code is not necessary
loadAsVt = false;
}
else if (vtype == ViewerType.Leaflet)
{
// We can't support this option for leaflet so disable
loadAsVt = false;
}
return await DownloadFeatureDataAsync(vl, layerNumber, name, stream, loadAsVt);
}
}
Expand Down
17 changes: 12 additions & 5 deletions Maestro.MapPublisher/viewer_content/viewer_leaflet.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
{
if (extLayer.Type == OverlayLayerType.GeoJSON_FromMapGuide)
{
<script type="text/javascript" src="@(((GeoJSONFromMapGuideOverlayLayer)extLayer).Downloaded.DataScriptRelPath)" charset="utf-8"></script>
<script type="text/javascript" src="@(((GeoJSONFromMapGuideOverlayLayer)extLayer).Downloaded.ConfigScriptRelPath)" charset="utf-8"></script>
<script type="text/javascript" src="@(((GeoJSONFromMapGuideOverlayLayer)extLayer).Downloaded.DataScriptRelPath)" charset="utf-8"></script>
<script type="text/javascript" src="@(((GeoJSONFromMapGuideOverlayLayer)extLayer).Downloaded.ConfigScriptRelPath)" charset="utf-8"></script>
}
}
}
Expand Down Expand Up @@ -110,7 +110,7 @@
{
case ExternalBaseLayerType.OSM:
<text>
var @(extLayer.Type)_@(counter) = L.tileLayer( '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
var @(extLayer.Type)_@(counter) = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: ['a','b','c']
});
Expand All @@ -119,7 +119,7 @@
break;
case ExternalBaseLayerType.Stamen:
<text>
var @(extLayer.Type)_@(counter) = L.tileLayer( '//stamen-tiles-{s}.a.ssl.fastly.net/@(extLayer.LayerType.ToString().ToLower())/{z}/{x}/{y}.png', {
var @(extLayer.Type)_@(counter) = L.tileLayer( 'https://stamen-tiles-{s}.a.ssl.fastly.net/@(extLayer.LayerType.ToString().ToLower())/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.',
subdomains: ['a','b','c']
});
Expand Down Expand Up @@ -257,7 +257,14 @@
}
}
var mainLayers = L.layerGroup([mainXYZImage, mainUTFGrid]);
var mainLayerList = [];
if (typeof(mainXYZImage) != 'undefined') {
mainLayerList.push(mainXYZImage);
}
if (typeof(mainUTFGrid) != 'undefined') {
mainLayerList.push(mainUTFGrid);
}
var mainLayers = L.layerGroup(mainLayerList);
var base = {};
var overlays = {};
Expand Down

0 comments on commit 87bb736

Please sign in to comment.