J
JJA
I've inherited some script that properly traces out a "rectangular
box" on a map in IE6 and IE7 but in Firefox the path of the mouse is
not visible. Could someone have a look and suggest something?
1. Browse to: http://gis.cbmiweb.com/MDWmaps/default.asp
2. Click the Zoom Box tool above the map (should change to yellow when
clicked)
3. Move mouse into map area and "draw" a zoom box by dragging out a
rectangle of choice
The zoom takes effect but the visible tracing of the rectangular zoom
box is only present with IE. With Firefox, there is no "feedback" to
the user while tracing out the "box".
I know the event model for FF is slightly different than IE. I think
the problem lies with the updateBand function in
http://gis.cbmiweb.com/MDWmaps/Scripts/Client_Functions.js but I don't
know how to fix for Firefox. Here is a snippet of that code:
// update rubber band
function updateBand(evt) {
var band = locateElement("band");
if (band != null) {
// move band taking care of different browsers
if (ie) {
evt = event;
var map = locateElement("map");
if (evt.srcElement != map)
return;
band.style.pixelLeft = selectMin(bandX, evt.offsetX +
GetOffsetLeft(map));
band.style.pixelTop = selectMin(bandY, evt.offsetY +
GetOffsetTop(map));
band.style.width = selectMax(bandX, evt.offsetX +
GetOffsetLeft(map)) - band.style.pixelLeft;
band.style.height = selectMax(bandY, evt.offsetY +
GetOffsetTop(map)) - band.style.pixelTop;
} else {
band.style.left = selectMin(bandX, evt.pageX);
band.style.top = selectMin(bandY, evt.pageY);
band.style.width = selectMax(bandX, evt.pageX) -
parseInt(band.style.left);
band.style.height = selectMax(bandY, evt.pageY) -
parseInt(band.style.top);
}
}
}
box" on a map in IE6 and IE7 but in Firefox the path of the mouse is
not visible. Could someone have a look and suggest something?
1. Browse to: http://gis.cbmiweb.com/MDWmaps/default.asp
2. Click the Zoom Box tool above the map (should change to yellow when
clicked)
3. Move mouse into map area and "draw" a zoom box by dragging out a
rectangle of choice
The zoom takes effect but the visible tracing of the rectangular zoom
box is only present with IE. With Firefox, there is no "feedback" to
the user while tracing out the "box".
I know the event model for FF is slightly different than IE. I think
the problem lies with the updateBand function in
http://gis.cbmiweb.com/MDWmaps/Scripts/Client_Functions.js but I don't
know how to fix for Firefox. Here is a snippet of that code:
// update rubber band
function updateBand(evt) {
var band = locateElement("band");
if (band != null) {
// move band taking care of different browsers
if (ie) {
evt = event;
var map = locateElement("map");
if (evt.srcElement != map)
return;
band.style.pixelLeft = selectMin(bandX, evt.offsetX +
GetOffsetLeft(map));
band.style.pixelTop = selectMin(bandY, evt.offsetY +
GetOffsetTop(map));
band.style.width = selectMax(bandX, evt.offsetX +
GetOffsetLeft(map)) - band.style.pixelLeft;
band.style.height = selectMax(bandY, evt.offsetY +
GetOffsetTop(map)) - band.style.pixelTop;
} else {
band.style.left = selectMin(bandX, evt.pageX);
band.style.top = selectMin(bandY, evt.pageY);
band.style.width = selectMax(bandX, evt.pageX) -
parseInt(band.style.left);
band.style.height = selectMax(bandY, evt.pageY) -
parseInt(band.style.top);
}
}
}