Weird, If i pan the map anywhere, the legend will disappear. (Later i found it relocated to somewhere else and will come back to the right position in some cases!)
This is also true to the compass arrow from the compass example.
any ideas?
Legendadornment layer disappear after panning map?
Hi Guangming,
This is a known issue in the earlier version and here are two options:
- using our latest development dll packages (7.0.314.0) or higher. One more thing I want to mention is we did a big upgrade on Mvc/Web edition since 7.0.282.0. So, before the replacement, I think do a backup at first is better.
- Still using the current dll packages, but do the below workaround:
Put this javascript in the head tag.
<script type=“text/javascript”>
var OnMapCreating = function(map) {
OpenLayers.Layer.AdornmentLayer = OpenLayers.Class(OpenLayers.Layer.WMS, {
moveTo: function (bounds, zoomChanged, dragging) {
OpenLayers.Layer.WMS.prototype.moveTo.apply(this, arguments);
if (!this.grid.length) {
OpenLayers.Util.modifyDOMElement(this.grid[0][0].frame,null, newOpenLayers.Pixel(0, 0), null, “relative”,null,null, null);
}
else {
var tile = this.grid[0][0];
var src = this.getURL(bounds);
tile.imgDiv.src = src + “&extra=” + Math.random();
}
}
});
};
</script>
Besides, I attached a test sample so that it is easy for you to test.
Any questions, please feel free to let me know.
Thanks,
Troy
DisplayALegend.txt (2.88 KB)
updates did not solve the problem:
i download my daily build, got a msi: “Map Suite Unmanaged Dependencies 7.0.291.0”. I managed to run this. Then changed my project references to those new versions from one of the extracted assemblies folder.
However now when i debug my app, i got this:
Unhandled exception at line 769, column 9 in localhost:20221//parser_GeoResource.axd
0x800a01b6 - JavaScript runtime error: Object doesn’t support property or method ‘createAdornmentOverlay’
seems that the script solves the problem. The newest dll 314 not ready for download.
I spend a lot of time test the latest one and found the latest one available to my account is still 313!
What a shame!
Hi Guangming,
The package 7.0.314.0 didn’t build out but The development dll package 7.0.316.0 is ready. please have a double check.
Sorry for any inconvenience.
Regards,
Troy
unfortunately the update package 7.0.316.0 did not solve the problem!
Guangming,
I have checked the package again, but it works fine in my end. Here is my test video with the codes I attached before.
screencast.com/t/H3dX0pF3W
Would you please clear the cache of browser and then have a try?
Thanks,
Troy
i feel it is also related browser compatibility specially of IE
Hi Guangming,
Your observation is correct. There is a known issue on IE8 as using svg, and we are working on it to figure out a better solution.
Sorry for any inconvenience.
Regards,
Troy