Move popup redraw after layer.moveTo in setCenter to fix google maps
redraw case. git-svn-id: http://svn.openlayers.org/trunk/openlayers@4253 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
height: 400px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||
<script type="text/javascript">
|
||||
var map, layer, popup;
|
||||
var markers, feature, marker;
|
||||
@@ -17,6 +18,9 @@
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
layer = new OpenLayers.Layer.Google( "Google",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
@@ -118,6 +122,7 @@
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
<p>If you open an anchoredbubble and switch to google, it shouldn't crash. If it does, don't release OpenLayers.</p>
|
||||
<div style="background-color:purple" onclick="add()"> click to add Popup to map</div>
|
||||
<div style="background-color:green" onclick="addMarker()"> click to add a Marker with an AnchoredBubble popup</div>
|
||||
<div style="background-color:blue" onclick="changer()"> click to modify popup's attributes</div>
|
||||
|
||||
@@ -1072,12 +1072,6 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
if (zoomChanged) {
|
||||
this.zoom = zoom;
|
||||
|
||||
//redraw popups
|
||||
for (var i = 0; i < this.popups.length; i++) {
|
||||
this.popups[i].updatePosition();
|
||||
}
|
||||
|
||||
// zoom level has changed, increment viewRequestID.
|
||||
this.viewRequestID++;
|
||||
}
|
||||
@@ -1114,6 +1108,13 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
}
|
||||
}
|
||||
|
||||
if (zoomChanged) {
|
||||
//redraw popups
|
||||
for (var i = 0; i < this.popups.length; i++) {
|
||||
this.popups[i].updatePosition();
|
||||
}
|
||||
}
|
||||
|
||||
this.events.triggerEvent("move");
|
||||
|
||||
if (zoomChanged) { this.events.triggerEvent("zoomend"); }
|
||||
|
||||
Reference in New Issue
Block a user