I'm using Ext JS with OpenLayers for the map in Drupal, where user can select different WMS maps.
I'm including following JS files:
http://extjs.cachefly.net/ext-2.2.1/...xt/ext-base.js
http://extjs.cachefly.net/ext-2.2.1/ext-all.js
on every page where I've link with popup to the map widget.
Here is the demo:
http://46.137.100.142/inspire/2_0_0_2/searchmapwms.htm
After integrated with others scripts, some of the variables contain weird __proto__ function called remove() which cause JS syntax errors.
In example:
Following code works without problems:
Code:
pairs = location.search.split("\?")[1].split("&");
for (i in pairs) {
keyval = pairs[i].split("=");
if (keyval[0] == "easting" || keyval[0] == "ebl")
this.eastBndLon = parseFloat(keyval[1]);
if (keyval[0] == "westing" || keyval[0] == "wbl")
this.westBndLon = parseFloat(keyval[1]);
if (keyval[0] == "northing" || keyval[0] == "nbl")
this.northBndLat = parseFloat(keyval[1]);
if (keyval[0] == "southing" || keyval[0] == "sbl")
this.southBndLat = parseFloat(keyval[1]);
if (keyval[0] == "url" || keyval[0] == "u")
this.urls.push(decodeURIComponent(keyval[1]));
}
But when I include Ext JS files, pairs contain somehow additional hidden function, which is counted as the last element of pairs, so code trying to execute:
Code:
pairs['remove'].split("=");
which is wrong.
Another example:
Code:
for (var n in userFlags) {
var flagInfo = userFlags[n].match(/(\w+)_(\d+)/);
var flagName = flagInfo[1];
var contentId = flagInfo[2];
// User flags always default to off and the JavaScript toggles them on.
if (templates[flagName + '_' + contentId]) {
$('.flag-' + flagName.flagNameToCSS() + '-' + contentId, context).after(templates[flagName + '_' + contentId]).remove();
}
}
userFlags contain 1 element, but has this weird function remove(). In Chrome Inspector you can't see that this object contain 2 elements, only in Firebug if you eventually analyse it more deeply.
And this code breaks with error:
Uncaught TypeError: Object function (
{var A=this.indexOf(
;if(A!=-1){this.splice(A,1)}return this} has no method 'match'
because last element of userFlags contains proto function:
Code:
remove: function (B){var A=this.indexOf(B);if(A!=-1){...
See the screenshot fo details.

