Ticket #2392 (closed bug: fixed)
Controls misbehave in WebKit browsers when vector layers present and map is rendered
|Reported by:||Nick M||Owned by:|
|Keywords:||webkit safari chrome vector render||Cc:|
This bug is present in both Safari 4.0.4 (Mac) and Chrome 184.108.40.206 (Mac).
If you initialize a Map object without passing a div to the constructor, and then later call map.render("map_div"), a number of oddities crop up when vector layers are used. I've attached an example page that demonstrates the bug, but basically it looks like mouse events aren't being properly handled. If you try to drag or pan the map around, the base layer will move, but the vector layer stays put. Additionally, it looks like other controls won't work. If I try to select the zoom or measure tools in our application, those tools don't work. Instead, the map keeps responding as if I were panning (with the base layer moving, and the vector layer staying put).
I've attached a patch with what I've found to be a solution. By appending the div to the document that's created when a div isn't supplied to the Map constructor, that seems to work. I'm not entirely sure if this is the best solution, but it seems to fix all these issues with vector layers and calling render() later on a map.
A few other notes:
* If I have a vector layer and a WMS layer on the map simultaneously, then the vector layer beings behaving. * If I use the Open Street Map layer as a base layer, instead of any Google layer, then the vector layer also beings behaving.