[Users] Problems with GeoAction and IE
ralph dell
rdellgis at gmail.com
Wed Oct 14 21:10:07 CEST 2009
I have added a control to a GeoExt.Action with a handler function. When the
toolbar item is clicked, using the handler I Open a window, that contains a
box component, and then as the map is clicked to draw a line I want to
write to the window on click 2,3,...
Everything works well in FireFox and Chrome, and not at all in IE (7 & 8)
In IE nothing is written to the box component on mouse clicks, the double
click to finish the line is sluggish and clicking the window Done button to
close the window throws an error.
I've beat my self up and am asking for suggestions and/or insights.
the live example is at http://www.gis.catawba.nc.us/ol/toolbar.html
Here is my control
var line= new OpenLayers.Control.DrawFeature(vector,
OpenLayers.Handler.Path, {
'callbacks': {
'point': addPoint
}
}
);
The toolbar action
action = new GeoExt.Action({
text: "draw line",
//control: new OpenLayers.Control.DrawFeature(
// vector, OpenLayers.Handler.Path
//),
control: line,
map: map,
toggleGroup: "draw",
allowDepress: false,
tooltip: "draw line",
handler: function(){
if(!win2){
point_count = 0;
total_distance = 0;
win2 = new Ext.Window({
applyTo:'mwin',
layout:'auto',
width:220,
height:'auto',
items: new Ext.BoxComponent({
applyTo:'bc2'
}),
CloseAction:'hide',
plain: false,
buttons: [{
text: 'DONE',
handler: function(){
win2.hide();
}
}]
});
}
win2.show(this);
},
group: "draw"
});
actions["draw_line"] = action;
toolbarItems.push(action);
The callback function
function addPoint(pt) {
var bc2;
point_count += 1;
if (point_count > 1) {
var dist;
dist = lastpt.distanceTo(pt);
total_distance += dist;
//the nex two line work in firefox, not inie
bc2 = Ext.get('bc2');
bc2.insertHtml('beforeEnd','<div>Distance: ' + dist.toFixed(1) +
'</div>');
} else {
// on the first mouse click do this
bc2 = Ext.get('bc2');
bc2.insertHtml('beforeEnd','<div>hello</div>');
}
lastpt = pt.clone();
}
The html
<div id='mwin' class="x-hidden">
<div class="x-window-header">Measure Distance</div>
<div id='bc2'>Click to add points</div>
</div>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20091014/0518670f/attachment.htm
More information about the Users
mailing list