Merge branch 'master' of https://github.com/openlayers/openlayers into control-inheritance

This commit is contained in:
Marc Jansen
2012-05-15 08:34:53 +02:00
45 changed files with 593 additions and 360 deletions

View File

@@ -172,11 +172,18 @@ OpenLayers.Control.Permalink = OpenLayers.Class(OpenLayers.Control, {
updateLink: function() {
var separator = this.anchor ? '#' : '?';
var href = this.base;
var anchor = null;
if (href.indexOf("#") != -1 && this.anchor == false) {
anchor = href.substring( href.indexOf("#"), href.length);
}
if (href.indexOf(separator) != -1) {
href = href.substring( 0, href.indexOf(separator) );
}
href += separator + OpenLayers.Util.getParameterString(this.createParams());
var splits = href.split("#");
href = splits[0] + separator+ OpenLayers.Util.getParameterString(this.createParams());
if (anchor) {
href += anchor;
}
if (this.anchor && !this.element) {
window.location.href = href;
}