Merge branch 'master' of https://github.com/openlayers/openlayers into control-inheritance
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user