views:

98

answers:

2

I have applied and configured CCK Location module to show node location on map (GMap, GMap location modules). However there is small issue that map does not show location at the centre (address marker is off the screen and user must scroll through the map to find it ;-).

It looks like map is centred one map screen off to the left (to the west) from where it supposed to be to show marker at the centre. I have tried to reinstall all those three modules, reset gmap macros to the simplest ones [gmap] all around but nothing helped.

Anyone knows what could be missing here?

A: 

Go to /admin/settings/gmap

Under the Default Map settings set the default size, zoom level and center of the map to what you want to show by default (before the location is selected).

Then go to /admin/content/node-type/[name-of-your-content-type]/fields/[name-of-your-location-cck-field]

(Basically click on the "configure" button after going to Manage fields for your content type)

In the GMap Macro, make sure it is something like this:

[gmap| zoom=7 | width=100% | height=400px ]

Note that it says A macro to be used as a base map for this field. This map will be recentered on the location, so the center is not that important.

See if this fixes your problem.

Sid NoParrots
Thank You. What it changed is that map shows one screen to the west.I do not know how to describe it better way: I need to drag map to the east a bit to find my marker.
Lukasz
A: 

After few hours of struggling I have discovered conflict between GMap and (Tabs or CCK FieldGroup tabs) module. I did put my location CCK map in field group as a tab. It looks like some javascript code conflicts there. Till now I came up with 2 solutions:

  1. Change your design and simply move gmap out of tab or place it on the first one.

  2. Override css style of .ui-tabs-hide class. Change line with left:-15000px (or similar) to left:50% or left:(half-width-of-your-map-in-pixels)px.

Do not touch any other styles and everything should work fine.

Maybe there are better solutions. If yes - please share.

Lukasz