Works for me, thanks.
There is a merge request for this feature.
This worked for me. Thank you.
the patch worked for me. Thanks.
After applying the patch I stopped seeing the error on my Drupal 7.97 installation. Thank you.
works for me too
I found out the code responsible for loading features was commented out in the geojson.js file:
if (this._forceReloadFeatures) {
this._loadingFeatures = true;
var projection = (this.getProjection()) ? this.getProjection() : data.map.getView().getProjection();
// data.opt.loader.call(this, extent, resolution, projection);
// // This has to be enabled / disabled before each loadFeatures
// // call.
// this._forceReloadFeatures = false;
// // Return an empty list - so the original loader is skipped.
// return [];
}
In can't find in the file history when was the change made, who did it and why.
It looks like the Hit tolerance functionality was removed in this commit.
I made the following change* to make this work (in the src/Plugin/Component/Popup/js/popup.js file). I replaced the old bit of code with the new one - see below.
The old code:
map.on('click', function(evt) {
if ('getFeaturesAtPixel' in map) {
// Introduced in v4.3.0 - new map.getFeaturesAtPixel() method.
var features = map.getFeaturesAtPixel(evt.pixel);
} else {
// Replaced in v4.3.0 - forEachFeatureAtPixel() method replaced.
features = [];
map.forEachFeatureAtPixel(evt.pixel, function(feature) {
features.push(feature);
});
}
var feature = undefined;
if (features && features.length > 0) {
for (item of features) {
feature = item;
}
}
});
The new code:
map.on('click', function(evt) {
var hitTolerance = data.opt.hitTolerance || 0;
if ('getFeaturesAtPixel' in map) {
// Introduced in v4.3.0 - new map.getFeaturesAtPixel() method with hitTolerance.
var features = map.getFeaturesAtPixel(evt.pixel, { hitTolerance: hitTolerance });
} else {
// Replaced in v4.3.0 - forEachFeatureAtPixel() method replaced.
features = [];
map.forEachFeatureAtPixel(evt.pixel, function(feature) {
features.push(feature);
});
}
var feature = undefined;
if (features && features.length > 0) {
for (item of features) {
feature = item;
}
}
});
* thank you ChatGPT :-)
I am setting the Hit Tolerance to 200 and get the same result as when is it set to 0. Maybe something has changed between releases 7.x-3.2 and 7.x-3.3 that I am using?
..a similar, bud unfortunately unanswered report/question was made in the past β by Dirkozoid.
I suspect this issue is caused by the fact that the PinchZoom, DragZoom and MouseWheelZoom methods generate fractional zoom level values, that are not expected by the code responsible for constraining the zoom range. There might be a way around this by setting constrainResolution to true in the map constructing code. However, I do not know in what file I should look at, to set that value.
A patch is provided https://git.drupalcode.org/project/openlayers/-/merge_requests/7.diff
There are more problematic places in that file, besides the one mentioned here. For example, I just run into:
Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /includes/unicode.inc on line 482
referring to:
function drupal_strlen($text) {
global $multibyte;
if ($multibyte == UNICODE_MULTIBYTE) {
return mb_strlen($text);
}
else {
// Do not count UTF-8 continuation bytes.
return strlen(preg_replace("/[\x80-\xBF]/", '', $text));
}
}
I encountered the error when adding a new action (adding a variable) into a rule, when clicking "Switch to data selection". The error appears in a JS dialog window.
sano β created an issue.
Works for me. Thank you.
Work for me with php 8. Thanks
The code changes applied to my module fixed the problem. I ported the patch to the 7.x-2.0 codebase.
sano β made their first commit to this issueβs fork.
After upgrading to php 8 the module stopped working (see the issue I mistakenly created π Type Error: count(): Argument #1 ($value) must be of type Countable|array, null given Active ), so I tried to use the most recent version of the library (version 1.14.1). When logging in, I saw an error about incompatibility between the setAuthorizationCode function declared in the library (1. below) and a function of the same name declared in the Storage.php of the module (2. below).
1. setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null, $code_challenge = null, $code_challenge_method = null)
2. setAuthorizationCode($code, $client_key, $uid, $redirect_uri, $expires, $scope = null, $id_token = null)
After adding the missing parameters into the function declared in the Storage.php of this module I was able to authenticate.
Actually, I just noticed that the issue is in the oauth2-server-php library.
sano β created an issue.
sano β created an issue.
I encountered the same error on a different line in the code and fixed it in the cited merge request.
sano β made their first commit to this issueβs fork.
works for me as well
sano β created an issue.
I edited the affected file on my system with the proposed changes and that solved the problem. Thanks.
The patch worked for me in php 8.1. Thank you.
The patch worked for me - with PHP 8.1. Thank you
The patch worked for me. Thank you.
Thank you. This fixed the problem for me with PHP 8.1
Tested on the version "7.x-2.3+8-dev" of the module.
Thanks for the patch. The hunk #1 failed to patch in my case, as the first line to replace differed:
$mcrypt = _encrypt_encryption_mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
Regardless, after adding "@" to the front of the function name (and the remaining two lines in the 1st hunk as well) suppressed the warnings.
Never mind. I did not have the Openlayers library module enabled. Once I did that, I see the OL3LayerSwitcher in the control types list. I guess, this issue can be closed now. Thank you again.
I was not aware there is another layer switcher, besides either the one I can turn on by enabling the layer switcher component (openlayers.Control:LayerSwitcher), or the layer switcher block. How do I activate the OL3LayerSwitcher you mention? Thank you for your help.
In the attached pic I am showing my map in a default state, after the page is loaded. The layer switcher content is shown. I would expect two things:
1. there should be a way to collapse the control into a smaller icon representing the layers in the map,
2. the default state should be the collapsed one (other folks might wish for the opposite)
By collapsing I mean similar behavior the attribution control works - in a default state one sees only the [ i ] icon. When clicked, the control expands to show the full attribution for the displayed map and a [>] button is also revealed by expanding, allowing user to collapse the control back.
I tested the default section stroke color and width using the most recent dev version and all works as expected. Thank you for your work.
I fixed this issue by modifying the Circle.js taking inspiration from the Icon.js, where token replacements work. I would create a patch, but my attempt to clone the repository failed.
I am not a JS programmer, so there likely are bugs in the attached file.
This is still a problem. Style values delivered by variables from Views are still not honored.
If I knew what file in this module makes the api call to the OL library when rendering a map, I would try finding the culprit.
By the way, I tried also the recommendation in #4, but see no change using this code:
var map = data.map;
var styleCache = {};
var styleFunction = function(feature, resolution) {
var name = feature.get('php_1');
var radius = 5;
var style = styleCache[radius];
if (!style) {
style = [new ol.style.Style({
image: new ol.style.Circle({
radius: radius,
fill: new ol.style.Fill({
color: 'rgba(255, 153, 0, 0.4)'
}),
stroke: new ol.style.Stroke({
color: name,
width: 10
})
})
})];
styleCache[radius] = style;
}
return style;
};
map.getLayers().forEach(function(layer){
var source = layer.getSource();
if (source.mn == 'openlayers_geofield_source_vector') {
layer.setStyle(styleFunction);
}
});
in the display used for export put a filtering condition to the query (into the Filter criteria section) that checks the current user role