Merge branch 'master' of https://github.com/openlayers/openlayers into no-$
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;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Format/WKT.js
|
||||
* @requires OpenLayers/Filter/Comparison.js
|
||||
* @requires OpenLayers/Filter/Logical.js
|
||||
* @requires OpenLayers/Filter/Spatial.js
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -799,7 +799,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
if (data[3] === 255) { // antialiased
|
||||
var id = data[2] + (256 * (data[1] + (256 * data[0])));
|
||||
if (id) {
|
||||
featureId = "OpenLayers.Feature.Vector_" + (id - 1 + this.hitOverflow);
|
||||
featureId = "OpenLayers_Feature_Vector_" + (id - 1 + this.hitOverflow);
|
||||
try {
|
||||
feature = this.features[featureId][0];
|
||||
} catch(err) {
|
||||
|
||||
@@ -61,7 +61,7 @@ OpenLayers.Style = OpenLayers.Class({
|
||||
rules: null,
|
||||
|
||||
/**
|
||||
* Property: context
|
||||
* APIProperty: context
|
||||
* {Object} An optional object with properties that symbolizers' property
|
||||
* values should be evaluated against. If no context is specified,
|
||||
* feature.attributes will be used
|
||||
|
||||
@@ -123,6 +123,17 @@ OpenLayers.Util.indexOf = function(array, obj) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Property: dotless
|
||||
* {RegExp}
|
||||
* Compiled regular expression to match dots ("."). This is used for replacing
|
||||
* dots in identifiers. Because object identifiers are frequently used for
|
||||
* DOM element identifiers by the library, we avoid using dots to make for
|
||||
* more sensible CSS selectors.
|
||||
*
|
||||
* TODO: Use a module pattern to avoid bloating the API with stuff like this.
|
||||
*/
|
||||
OpenLayers.Util.dotless = /\./g;
|
||||
|
||||
/**
|
||||
* Function: modifyDOMElement
|
||||
@@ -132,7 +143,8 @@ OpenLayers.Util.indexOf = function(array, obj) {
|
||||
*
|
||||
* Parameters:
|
||||
* element - {DOMElement} DOM element to modify.
|
||||
* id - {String} The element id attribute to set.
|
||||
* id - {String} The element id attribute to set. Note that dots (".") will be
|
||||
* replaced with underscore ("_") in setting the element id.
|
||||
* px - {<OpenLayers.Pixel>|Object} The element left and top position,
|
||||
* OpenLayers.Pixel or an object with
|
||||
* a 'x' and 'y' properties.
|
||||
@@ -150,7 +162,7 @@ OpenLayers.Util.modifyDOMElement = function(element, id, px, sz, position,
|
||||
border, overflow, opacity) {
|
||||
|
||||
if (id) {
|
||||
element.id = id;
|
||||
element.id = id.replace(OpenLayers.Util.dotless, "_");
|
||||
}
|
||||
if (px) {
|
||||
element.style.left = px.x + "px";
|
||||
@@ -188,7 +200,8 @@ OpenLayers.Util.modifyDOMElement = function(element, id, px, sz, position,
|
||||
* Parameters:
|
||||
* id - {String} An identifier for this element. If no id is
|
||||
* passed an identifier will be created
|
||||
* automatically.
|
||||
* automatically. Note that dots (".") will be replaced with
|
||||
* underscore ("_") when generating ids.
|
||||
* px - {<OpenLayers.Pixel>|Object} The element left and top position,
|
||||
* OpenLayers.Pixel or an object with
|
||||
* a 'x' and 'y' properties.
|
||||
@@ -921,6 +934,7 @@ OpenLayers.Util.lastSeqID = 0;
|
||||
*
|
||||
* Parameters:
|
||||
* prefix - {String} Optional string to prefix unique id. Default is "id_".
|
||||
* Note that dots (".") in the prefix will be replaced with underscore ("_").
|
||||
*
|
||||
* Returns:
|
||||
* {String} A unique id string, built on the passed in prefix.
|
||||
@@ -928,6 +942,8 @@ OpenLayers.Util.lastSeqID = 0;
|
||||
OpenLayers.Util.createUniqueID = function(prefix) {
|
||||
if (prefix == null) {
|
||||
prefix = "id_";
|
||||
} else {
|
||||
prefix = prefix.replace(OpenLayers.Util.dotless, "_");
|
||||
}
|
||||
OpenLayers.Util.lastSeqID += 1;
|
||||
return prefix + OpenLayers.Util.lastSeqID;
|
||||
|
||||
Reference in New Issue
Block a user