marker flicker bug

1,167 views
Skip to first unread message

Farooq Mahmood

unread,
Sep 24, 2010, 2:13:59 AM9/24/10
to Google Maps JavaScript API v3
Hi,

I am getting a very strange behavior while changing the marker's icon
on mouse hover. Marker is changing its location as well on mouseover.
When I look at the change it seem like that this was a bug and has
been fixed on 3.1 Jun 17, 2010 (if it is the same issue).

I have a marker mentioning an earthquake in Afghanistan and on
mouseover this marker move to middle of India but on mouseout it move
back to Afghanistan. :)

Regards,
Farooq

Rossko

unread,
Sep 24, 2010, 4:36:12 AM9/24/10
to Google Maps JavaScript API v3
> I am getting a very strange behavior while changing the marker's icon
> on mouse hover. Marker is changing its location as well on mouseover.
> When I look at the change it seem like that this was a bug and has
> been fixed on 3.1 Jun 17, 2010 (if it is the same issue).

Don't shout 'bug' unless you can provide a demonstration
http://groups.google.com/group/google-maps-api/web/why-including-a-link-is-critical

As we can only guess, my guess is that you haven't set the image
anchor properties properly.

Farooq Mahmood

unread,
Sep 28, 2010, 4:06:42 AM9/28/10
to Google Maps JavaScript API v3
Thanks for the reply and sorry if you get offended, I think I have
mentioned everything thing quite clear in my post regarding the word
'bug'.

Regards,
Farooq

On Sep 24, 6:36 pm, Rossko <ros...@culzean.clara.co.uk> wrote:
> > I am getting a very strange behavior while changing the marker's icon
> > on mouse hover. Marker is changing its location as well on mouseover.
> > When I look at the change it seem like that this was a bug and has
> > been fixed on 3.1 Jun 17, 2010 (if it is the same issue).
>
> Don't shout 'bug' unless you can provide a demonstrationhttp://groups.google.com/group/google-maps-api/web/why-including-a-li...

Luke Mahé

unread,
Sep 28, 2010, 4:33:11 AM9/28/10
to google-map...@googlegroups.com
Hey Farooq,

As Rossko said, it would really help if you could supply a link that demonstrates the problem you are having. 

It saves everyone having to do the work that you have already done and will most probably mean a quicker and more accurate response :)

Thanks!

-- Luke


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Pil

unread,
Sep 28, 2010, 5:22:08 AM9/28/10
to Google Maps JavaScript API v3
What browser are you using? Do you use a sprite image as marker icon?
A link to the problematic map would be a good idea.

I'm asking because there is a reproducable flicker bug with the icons
- but only in IE 6 and when using a sprite image for the marker icons.


http://www.wolfpil.de/v3/toggle-cats.html

This seems to be a CSS bug in IE 6 (well, just one of many others).
And since the v3 Maps API doesn't support IE 6 any more, I think it
shouldn't be fixed.

(Much too time-consuming for only the worst of all browsers.)

So the easiest solution would be in this case to use a separate icon
for all markers and a separate hover icon.

Farooq Mahmood

unread,
Sep 28, 2010, 10:11:55 PM9/28/10
to Google Maps JavaScript API v3
Rossko's guess was right It was anchor property problem. Here is the
code I am using to get the anchor.

function getImgAnchor(imgSrc){
var newImg = new Image();
newImg.src = imgSrc;
var x = newImg.width
var y = newImg.height;
var point = new google.maps.Point(x/2 , y/2);
alert(imgSrc + " : " + point);
return point;
}

Sometimes that var x and y are just 0, 0 even newImg.width and
newImg.height have different values e.g. (12, 12).
Anyway it is not a google maps issue rather than javascript issue.

Thanks Rossko for the perfect guess.

Regards,
Farooq

Martin

unread,
Sep 29, 2010, 4:26:16 AM9/29/10
to Google Maps JavaScript API v3
You'd probably need to create an 'onload' event for the image object
and get the image width and height AFTER it has loaded.

Martin.

Farooq Mahmood

unread,
Sep 30, 2010, 1:29:30 AM9/30/10
to Google Maps JavaScript API v3
hmmm.. Thanks Martin.
Reply all
Reply to author
Forward
0 new messages