I need to be able to auto-zoom to the location I've setup in the node. I'm using geocoder and it's working very well. The view shows the map point fine, and the map zooms into what's specified within the preset "Center + Bounds". However, when I try to use the "Zoom to location" behaviour, I'm getting terribly confused.
How do I use the geocoder query, or another method to auto-zoom into the location? The replacements patterns don't show the WKT field, which is what I would assume be used here. Please help, any suggestions would be greatly appreciated.
****
Zoom to location
Zoom to the boundary box of a specified location.
GEOCODER QUERY:
Query submitted to the geocoder. You can use replacement patterns below.
Query replacement patterns
Token Replacement value
Openlayers data tokens
[maps_openlayers_1-name] Attriubute: name
[maps_openlayers_1-title] Attriubute: title
[maps_openlayers_1-description] Attriubute: description
[maps_openlayers_1-field_prop_notes_value] Attriubute: field_prop_notes_value
Comments
Comment #1
Devcal commented+1
Comment #2
ademarco commentedMoving to Openlayers Geocoder issue queue.
Comment #3
c-c-m commentedI have the same question here
Comment #4
Anonymous (not verified) commentedI also do not have an idea how to handle this, but would be interested in a solution.
Comment #5
c-c-m commentedIn order to achieve zooming to extents, you have to do the following:
It's pretty simple when you find the correct place!
Hope it helps.
Comment #6
Anonymous (not verified) commentedThis unfortunately does not work in here. If I chose e.g. zoom to layer with "google_normal" the zoom level does not have an influence. It might work with zooming to a views layer, I have not tried, yet.
Neverthless the apropriate point for the current node gets properly displayed, even without a views layer. Only zooming does not work.
I have the hope that there is a way for zooming properly without a views layer.
Comment #8
Anonymous (not verified) commentedShould be reopened. From my point of view it is not fixed.
Comment #9
avr commentedIn order to get the value from the "Zoom to Layer" configuration to effect the "Zoom to Location" you need to add a couple lines of javascript to openlayers_geocoder_zooomtolocation.js.
Specifically, you should add:
so the final file looks like:
Comment #10
Anonymous (not verified) commentedThanks avr for the hint. I changed it and uploaded the .js file. Nevertheless it does not seem to have any influence at all.
Whether setting the Zoom to layer point zoom level to 5, 10 or 15 does not change the map display.
Is there any other setting I could have forgotten? Also changeing the initial zoom level does not change anything.
Comment #11
keyser79 commentedHere is what I did to achieve this functionality. My objective is to show a map on the node display to show the node's location. I have an OpenLayers WKT field with the geocoder widget type.
-Create a new Openlayers View. Add Nid as an argument and select the "provide a default argument" option under the "Action to take if argument is not present". Then select "Node ID from URL". Also select the WKT CCK as the field for this view.
-Create a new OpenLayers preset (or clone the default one). On the Layers and Styles tab make sure to enable the overlay that you just created in views. Then under the Behaviors tab, select "zoom to layer" and select the overlay view that you just enabled.
This is what worked for me. Its important that when you create a view, the view only chooses the one WKT value that corresponds to the node (hence the Nid argument).
Comment #12
Max1 commented