[mapguide-commits] r9554 - sandbox/jng/tiling_v3/Doc/samples/ol2samples/hybrid
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Jun 17 06:19:08 PDT 2019
Author: jng
Date: 2019-06-17 06:19:08 -0700 (Mon, 17 Jun 2019)
New Revision: 9554
Modified:
sandbox/jng/tiling_v3/Doc/samples/ol2samples/hybrid/index.html
Log:
Prevent loading non-image tilesets in "hybrid" sample
Modified: sandbox/jng/tiling_v3/Doc/samples/ol2samples/hybrid/index.html
===================================================================
--- sandbox/jng/tiling_v3/Doc/samples/ol2samples/hybrid/index.html 2019-06-17 13:10:46 UTC (rev 9553)
+++ sandbox/jng/tiling_v3/Doc/samples/ol2samples/hybrid/index.html 2019-06-17 13:19:08 UTC (rev 9554)
@@ -90,6 +90,12 @@
});
}
+ var TILE_IMAGE_FORMATS = [
+ "PNG",
+ "PNG8",
+ "GIF",
+ "JPG"
+ ];
var activeMap = null;
function createMap(mapDef, session, reqFeatures) {
@@ -113,8 +119,12 @@
if (activeMap) {
activeMap.destroy();
}
- activeMap = new MapViewModel("#wrap", data, jqXHR.responseText.length);
- $("#error").html("");
+ if (TILE_IMAGE_FORMATS.indexOf(data.RuntimeMap.TileFormat) >= 0) {
+ activeMap = new MapViewModel("#wrap", data, jqXHR.responseText.length);
+ $("#error").html("");
+ } else {
+ $("#error").html("This map links to a non-image tile set. Cannot load it");
+ }
}).error(function (jqXHR, textStatus, errorThrown) {
$("#error").html(jqXHR.responseText);
});
More information about the mapguide-commits
mailing list