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.
Context
We are using addressfield, geofield and geocode to store locations. Addresses are sometimes incomplete (e.g. street names only, without house numbers), so geocode cannot pinpoint. Our fallback is OpenLayers widget. Idea is to move marker from approximate to precise location on map.
Problem
Map cannot zoom and center on marker. So even when user hits node save and reloads node editing form, map keeps initial center and zoom.
Screenshot of setting:
Screenshot of resulting map:
Same settings work fine in node view. Problem seems to be only with widget.
Enabled modules
- OpenLayers-7.x-2.0-beta7+8-dev
- Geofield-7.x-2.0-alpha2+9-dev
- Addressfield-7.x-1.0-beta4
- Geocoder-7.x-1.2
Comment | File | Size | Author |
---|---|---|---|
2013-06-25_1123.png | 431.32 KB | bbujisic | |
2013-06-25_1120.png | 10.73 KB | bbujisic |
Comments
Comment #1
le dendrite CreditAttribution: le dendrite commentedBump Bump
I concur; this is not working for me either.
I seem to be having a related issue, but with some caveats.
Likely the same issue manifested another way...
Goal.
Essentially what I'd like to accomplish is to use the Display map of a parent/ related node as the select Widget for the child/ related node, of a different content type.
*In my use case I cannot use the actual display map but rather I need to get its location via Views.
Build.
Using Geofield, Openlayers, Views, References: Node Reference URL widget. Also trying views utilizing a Geocoder field, again with no success.
I have created a Display map as well as a Widget map for each content type and I do think I have configured them correctly.
This has left me trying endless variations in my Openlayers Data Overlay View (select widget)
Prior to reading this post I was thinking I was just not getting the View correct (also still possible), or suspecting a possible inability to pull the location via the Node Reference URL Widget, Which lead me to trying to use a Geocoder field, no luck.
Can anyone offer any further insight into this?
Has anyone accomplished this?
Just as Branislav Bujisic stated, the node displays work fine, but I cant seem to accomplish the same with a widget.
I have a live sandbox setup I can toss an account to someone if they wanna look. hit me up.
Related Post: https://drupal.org/node/1987204
Installs.
Drupal core 7.24
Chaos tool suite (ctools) 7.x-1.3
Geofield 7.x-2.1
Geocoder 7.x-1.2
geoPHP 7.x-1.7
Proj4JS 7.x-1.2
References 7.x-2.1
Node Reference URL Widget 7.x-1.12
OpenLayers 7.x-2.0-beta7
Views 7.x-3.7
---------
Update
Oddly I've found this is working on some content types and not others. I cannot find any wrong settings so I will try recreating the problem content types and see where that gets me.
So this leads me to think my issue may not be the same as the author of this original post.
Comment #2
Exploratus CreditAttribution: Exploratus commentedI have the same problem
Comment #3
umakart CreditAttribution: umakart commentedHere the same:
geofield_widget_map cannot zoom and center on marker.
(zoom to Layer)
geofield_formatter_map does.
Is there no solution for this problem?
Comment #4
Max1 CreditAttribution: Max1 commentedComment #5
Max1 CreditAttribution: Max1 commentedComment #6
Max1 CreditAttribution: Max1 commentedComment #7
Max1 CreditAttribution: Max1 commentedComment #8
Max1 CreditAttribution: Max1 commentedThis bug has 2-year history, many followers and reentered tickets (I found at least four, added here), as well as references on other sites. The bug reproduces on last stable version Openlayers2 and on last dev version too. And it looks annoying to users.
Can I set the priority to Major?
Comment #9
Max1 CreditAttribution: Max1 commentedComment #10
Max1 CreditAttribution: Max1 commentedComment #11
Max1 CreditAttribution: Max1 commentedComment #12
Max1 CreditAttribution: Max1 commentedComment #13
t_stallmann CreditAttribution: t_stallmann commentedNot sure how many people are still seeing this issue, but I ran into it as well locally and wanted to report back from some digging.. it seems like the geofield placeholder actually adds a 2nd vector layer with the data in it when the map renders, but the javascript for the Zoom to Layer plugin filters this layer out because it has a `drupal_id` which does not match any of the layers which have been selected in the UI. On the site I'm working on a simple fix was to add a new custom "Zoom to All Layers" behavior which duplicates the "Zoom to Layer" behavior but replaces the
var layers = ...
line with