Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've just updated to the latest dev version so my maps will work in IE, and while they are now working in IE8, IE7 displays this error and no map:
Message: Expected identifier, string or number
Line: 18
Char: 5
Code: 0
URI: http://www.ava.asn.au/sites/www.ava.asn.au/modules/ava_module/layer-hand...
The file in question is part of a custom module I wrote to add my own map layer. However, it works fine in IE8, so I'm hoping someone can help me fix it for IE7 too:
OL.Layers.TMS = function(layerOptions, mapid) {
// Avoid pink tiles
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
return new OpenLayers.Layer.TMS(
"TMS Layer",
"http://www.ava.asn.au/sites/www.ava.asn.au/files/floor_plan/",
{
maxExtent: new OpenLayers.Bounds(0.0, 0.0, 1508.0, 1524.0),
numZoomLevels: 4,
type: 'jpg',
getURL: overlay_getTileURL,
} // <-- This is the line referred to by the error...
);
}
function overlay_getTileURL(bounds) {
var res = this.map.getResolution();
var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
var y = Math.round((bounds.bottom - this.maxExtent.bottom) / (res * this.tileSize.h));
var z = this.map.getZoom();
if (x >= 0 && y >= 0) {
return this.url + z + "/" + x + "/" + y + "." + this.type;
} else {
return "http://www.maptiler.org/img/none.png";
}
}
Comments
Comment #1
tmcw CreditAttribution: tmcw commentedRemove the comma before the }.
Comment #2
BWPanda CreditAttribution: BWPanda commentedWow, I didn't realise IE7 could be so pedantic...
Thanks, works perfectly now!
Comment #3
tmcw CreditAttribution: tmcw commentedOh, IE will surprise you. Always in bad ways.
Comment #4
BWPanda CreditAttribution: BWPanda commented:)