Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am not able to configure the leaflet in display format of the view.
When I added the leaflet in Display format I get the error "Style Leaflet requires a leaflet map to be configured drupal".
Please suggest
Comment | File | Size | Author |
---|---|---|---|
#6 | leaflet-style-leaflet-error-2683221-6.patch | 786 bytes | alarcombe |
leaflet-error.png | 130.5 KB | pallavi_sugandhi |
Comments
Comment #2
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedSame problem here. Also with the current dev version at https://www.drupal.org/node/2070343.
For me it seems, as only the old leaflet map style plugin is fully implemented at the moment. When you look at
leaflet_views/config/schema/leaflet_views.style.schema.yml
onlyviews.style.leafet_map
is defined.Both styles are mapped to
which creates the confusion.
So there needs to be an schema added for the Leaflet.php and the id changed in the class annotations.
Or did we misundestood the naming and we need to add a Leaflet Map (old) at first, before we can add a Leaflet style? Then it shouldn't be a `display_types = {"normal"},` and then not available when creating a view.
Comment #3
pvhee CreditAttribution: pvhee at Marzee commentedOnly the old leaflet map style is fully implemented indeed, so the new leaflet map style still needs some work (see also https://www.drupal.org/node/2589671)/. Once completed, we can make a first beta release of the module, so patches welcome!
Comment #4
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedWhat's the purpose of the new leaflet map style? Should it be used only for refactoring or will there be another feature set? And if yes, which ones?
Comment #5
juliencarnot CreditAttribution: juliencarnot commentedSame problem here. Does the refactoring patch at https://www.drupal.org/node/2745851 cover this issue, or are they separate?
Good questions in #4 szeidler, I was wondering the same!
Comment #6
alarcombe CreditAttribution: alarcombe commentedThis error was still occurring for me at commit da0386d50987b63199937163bfe438807e7affcd which was after the refactoring patch was committed. What worked for me was removing the validate() method from the Leaflet views style, as I believe it is being called too early. For me, removing this function had no direct effects on creating and using a view, but it *might* cause problems if importing a malformed view (though it's arguable that's a bit of an edge case).
Comment #7
alarcombe CreditAttribution: alarcombe commentedComment #8
ckaotikA map selection is already enforced by the form element being
#required
, so the validation should not be necessary.However, because of that there should not be an error at all. What I've noticed is that the map option is only saved when the map height is changed, too. After the initial save, map height can again be set to the default value and saving still works. Might be worth investigating.