Hi,

I have a directory of business listings, each with a map, to be found easily.

In the form to create the listing the user is only required to type in their address, which is then geocoded. The problem is that, when I open the resulting listing, the rendered map shows the marker correctly placed, but it's centered and zoomed according to the default setting, so that the information it provides is useless, because it requires that the reader manually centers and zooms in the map to see any decent level of detail.

I can set the zoom default high, since every result is only going to show one point on the map, but how do I tell to the map that I want it to center on the single specific result?

If this module doesn't do this out of the box, is there one that does? (It would be pretty strange if it didn't. What's the use of a map that needs to be manipulated to be useful?)

Thank you.

Comments

darioshanghai’s picture

Component: OL Behaviors » Documentation
Category: support » task

I figured it out: it's done through the option "zoom to layer" in the map's behaviours.

Turning this into a documentation issue. A few examples for the behaviours in the documentation would really help.

kevinquillen’s picture

Darioshanghai I checked it off, but it does not center and zoom to the pin on the map.

Rob_Feature’s picture

Yeah, this should be in the docs....thanks for posting it here darioshanghai

kevinquillen’s picture

If you're showing just one layer, then zoom/center on point works. You can't share layers between maps because only one layer can have this set- if this makes sense. Thats where I was going wrong.

wemmies’s picture

@kevinquillen I was having the same problem. I had 3 different layers I wanted to show in one map. Every layer has a different nodetype and marker colour.
Than I wanted to have the map zoom to a specific country when that was selected in exposedfilters. The problem I got was that on the layer selected to zoom the map to, the markers still displayed, the other node types dissapeared.
I solved this by doing the following:
- Create 3 different layers for every nodetype
- Create 1 layer with all 3 nodetypes and an exposed filter for country (that layer only)
- enable all four layers
- display only the different nodetype layers
- zoom to layer set to the 4th layer with all 3 nodetypes.

This will keep showing all markers in other countries, but the map will zoom to the country selected.

ifrik’s picture

Assigned: Unassigned » ifrik
ifrik’s picture

Status: Active » Needs work
clemens.tolboom’s picture

I've added a book page http://drupal.org/node/1883266