Compare commits

..

4 Commits

Author SHA1 Message Date
Bart van den Eijnden
d0f8fa3ecf set version number to RC2 2013-05-13 13:25:03 +02:00
Éric Lemoine
e9a349e4f1 Make feature handler propagate touch events
This commit is a follow-up on issue #294 (commit a6119f6) and #861 (commit c7a4045). The feature handler should not stop the bubbling up of browser events. In this particular case, when the feature handler is activate, Sencha Touch will trigger longpress events when panning the map because the feature handler stops touchmove.
2013-05-13 13:17:02 +02:00
ahocevar
8b4592e71a We are dealing with strings for comparison
Because OpenLayers.Util.getParameters turns comma delimited values into
arrays, comparing e.g. bbox values in urls will return false. By
introducing a splitArgs option, we can use getParameters in a way that
leaves such values as strings and makes them comparable in
OpenLayers.Util.isEquivalentUrl.
2013-05-13 13:01:21 +02:00
iacovlev-pavel
7c5afe1acf Add OpenLayers/Control.js to "requires"
Fix issue #969
2013-05-13 13:01:21 +02:00
6 changed files with 27 additions and 9 deletions

View File

@@ -425,4 +425,4 @@
* When asking questions or reporting issues, make sure to include the output of
* OpenLayers.VERSION_NUMBER in the question or issue-description.
*/
OpenLayers.VERSION_NUMBER="Release 2.13-rc1";
OpenLayers.VERSION_NUMBER="Release 2.13-rc2";

View File

@@ -4,6 +4,7 @@
* full text of the license. */
/**
* @requires OpenLayers/Control.js
* @requires OpenLayers/Handler/Drag.js
* @requires OpenLayers/Handler/Keyboard.js
*/

View File

@@ -147,7 +147,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
* evt - {Event}
*/
touchmove: function(evt) {
OpenLayers.Event.stop(evt);
OpenLayers.Event.preventDefault(evt);
},
/**
@@ -278,7 +278,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
if(type === "touchstart") {
// stop the event to prevent Android Webkit from
// "flashing" the map div
OpenLayers.Event.stop(evt);
OpenLayers.Event.preventDefault(evt);
}
var inNew = (this.feature != this.lastFeature);
if(this.geometryTypeMatches(this.feature)) {

View File

@@ -7,7 +7,7 @@ var OpenLayers = {
/**
* Constant: VERSION_NUMBER
*/
VERSION_NUMBER: "Release 2.13-rc1",
VERSION_NUMBER: "Release 2.13-rc2",
/**
* Constant: singleFile

View File

@@ -866,11 +866,17 @@ OpenLayers.Util.destinationVincenty = function(lonlat, brng, dist) {
* url - {String} Optional url used to extract the query string.
* If url is null or is not supplied, query string is taken
* from the page location.
* options - {Object} Additional options. Optional.
*
* Valid options:
* splitArgs - {Boolean} Split comma delimited params into arrays? Default is
* true.
*
* Returns:
* {Object} An object of key/value pairs from the query string.
*/
OpenLayers.Util.getParameters = function(url) {
OpenLayers.Util.getParameters = function(url, options) {
options = options || {};
// if no url specified, take it from the location bar
url = (url === null || url === undefined) ? window.location.href : url;
@@ -906,7 +912,9 @@ OpenLayers.Util.getParameters = function(url) {
}
// follow OGC convention of comma delimited values
value = value.split(",");
if (options.splitArgs !== false) {
value = value.split(",");
}
//if there's only one value, do not return as array
if (value.length == 1) {
@@ -1299,7 +1307,8 @@ OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) {
OpenLayers.Util.applyDefaults(options, {
ignoreCase: true,
ignorePort80: true,
ignoreHash: true
ignoreHash: true,
splitArgs: false
});
var urlObj1 = OpenLayers.Util.createUrlObject(url1, options);
@@ -1340,6 +1349,8 @@ OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) {
* ignoreCase - {Boolean} lowercase url,
* ignorePort80 - {Boolean} don't include explicit port if port is 80,
* ignoreHash - {Boolean} Don't include part of url after the hash (#).
* splitArgs - {Boolean} Split comma delimited params into arrays? Default is
* true.
*
* Returns:
* {Object} An object with separate url, a, port, host, and args parsed out
@@ -1395,7 +1406,8 @@ OpenLayers.Util.createUrlObject = function(url, options) {
var qMark = url.indexOf("?");
queryString = (qMark != -1) ? url.substr(qMark) : "";
}
urlObject.args = OpenLayers.Util.getParameters(queryString);
urlObject.args = OpenLayers.Util.getParameters(queryString,
{splitArgs: options.splitArgs});
// pathname
//

View File

@@ -783,7 +783,7 @@
}
function test_Util_isEquivalentUrl(t) {
t.plan(9);
t.plan(10);
var url1, url2, options;
@@ -846,6 +846,11 @@
url2 = new Array(window.location.pathname.split("/").length-1).join("../")+"foo/bar";
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "absolute and relative path without host works for "+url2)
//ARGS
url1 = "foo.html?bbox=1,2,3,4",
url2 = url1;
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "equal urls with comma delimited params are equal");
}
function test_createUrlObject(t) {