Hello,
I'm using Gmap and Location on a website. Everything is working fine but a few weeks ago I lost the central position of the marker. I use the default location map block. Can someone help me?

Comments

spasmody’s picture

nobody?

pauldawg’s picture

More specifically, the problem here is that the GMap is not repositioning at all. Rather, it is only using the default center. I have a bunch of nodes being displayed in my home state, so I never notices the problem, but now I am getting nodes created from other states, and the GMap is still displaying the default center, in my home state, and the actual address and the marker are off-screen.

spasmody’s picture

In my case the gmap window is the right one but the marker is on the top-left corner. Why?

pauldawg’s picture

My guess is that your default center settings for the module are within the same window as the marker so the marker is visible. That is what I am experiencing, so it sounds like you are seeing the same thing. Have you tried viewing a map where the marker is far from your default center?

baaj’s picture

There are settings within the marker ini file that lets you set the x,y coordinates of your image as the "point" of your custom markers. if not specified I think they default to the image top left

spasmody’s picture

indeed baaj here is the content of the file :

; Defaults
[defaults]
;shadow = ""
anchorX = 10
anchorY = 29
infoX = 17
infoY = 6

; Marker sets
[mymarker]
name = "mymarker"
sequence = "mymarker.png"

; Files

But I think these (default) settings are correct, isn't it?

baaj’s picture

They're correct if all your custom markers 20px X 29px, otherwise change the anchorX and Y values

If you make any changes, remember to rebuild your marker cache on the gmap settings page.

spasmody’s picture

Yes, I can actually change the marker position, I found a good result with negative values:

; Defaults
[defaults]
;shadow = ""
anchorX = -80
anchorY = -80
infoX = 17
infoY = 6

; Marker sets
[mymarker]
name = "mymarker"
sequence = "mymarker.png"

; Files

but unfortunately the map area changes in the same time, i.e. it doesn't cover all the gmap window anymore.
Can I change the display area as well?

baaj’s picture

Try using positive values - the negatives are messing with the map display. If your image is 30 x 30 and your pinpoint is the bottm center (like most markers) then use

; Defaults
[defaults]
;shadow = ""
anchorX = 15
anchorY = 30
spasmody’s picture

So, with that configuration

image = 30x30
anchorX = 15
anchorY = 30
infoX = 17
infoY = 6

and after regenerating marker cache, the marker is still on the top-left corner (but on the right place on the map). In addition the map still doesn't cover all the window.
I have already reinstalled the module. I don't understand. Is there other setting somewhere?

baaj’s picture

hmmm....
Are your markers all the same size? If not you need to set these for each one
And you declared the custom marker images below these anchorx,y defaults?

; Marker sets
[blue]
name = "Blue"
sequence = "blue.png"

[gray]
name = "Gray"
sequence = "gray.png"

Try clearing your drupal cache also.

spasmody’s picture

hummmm,
it's better with these settings :

; Marker sets
[mymarker]
name = "mymarker"
sequence = "mymarker.png"
anchorX = 15
anchorY = 30
infoX = 17
infoY = 6

but it's not perfect, especially when I zoom :

http://passpass.biz/lieux/908/grand-palais

(carte du lieu)
In addition the marker position is different for anon and auth
But I clear both marker and drupal caches
I become crazy...

baaj’s picture

Re: crazy - I've been working to try to fix a bug in gmaps for TWO whole days (and nobody's replying to my thread). About to go crazy myself...

Anyway, i think I found your problem - your marker looks like this below, yeah?

__
| |
|_|
/

This would make the pinpoint on the bottom left.
So the anchorX should be 0

Is this a view in a block or a straight gmap module? The size of the map rendering is not the same as the block.

Nice site btw - :) you've done a great job breaking out from the drupal box.

spasmody’s picture

ok baaj, it seems to be better now since I reestablished the widths (which are the same). Thank you very much. But it remains a problem for auth. The marker problem is fixed for anon but it is still not visible for auth. Obviously the permissions are similar. It's strange.

johnv’s picture

Status: Active » Closed (won't fix)

Closing this very old issue. Please reopen if it is still valid.

arsalan2411’s picture

Issue summary: View changes

I was trying to show GMap on a node inside quick-tab. A specific quick tab was supposed to shows Google Map, but it was mis-behaving as:
1- Marker was not center aligned.
2- Map does not show up by default, rather it shows up upon page inspect.

I fixed it (sort of hard coded it) by getting appending quick-tab id to URL on click. It solved both of the above mentioned problems.

jQuery('#quicktabs-tab-premium_auction_house-3').click(function() {
var separator = (window.location.href.indexOf("?")===-1)?"?":"&";
window.location.href = window.location.href + separator + "qt-premium_auction_house=3#qt-premium_auction_house";
});

I found a useful tip at https://www.drupal.org/node/2038651