Changing gmap marker icons while onclick

4,706 views
Skip to first unread message

kalyan

unread,
Jan 18, 2011, 12:47:30 PM1/18/11
to Google Maps JavaScript API v3
Is there any way to change gmap marker icon while onclick and get back
its original icon while clicking another marker or map. Suppose, In my
gmap, I'm showing events in different colors(icon's). while clicking a
marker the icon should change to yellow and should get back its
original color when clicking another marker on the map. Thanks in
advance..

geoco...@gmail.com

unread,
Jan 18, 2011, 3:11:44 PM1/18/11
to Google Maps JavaScript API v3
Something like this?
http://www.geocodezip.com/v3_MW_example_hoverchange.html
(changes the markers on mouseover not click, ported from Mike
Williams' v2 example)

-- Larry

yosra ayed

unread,
Jan 18, 2011, 1:06:28 PM1/18/11
to google-map...@googlegroups.com
yes it's work i can change also i can show and hide a marker.
My problem is that markers appears in one map but not in two maps simultaneously.
in other words, can i have two maps each one appears on a qwidget(widget of Qt) and is there any probleme for the listener?
thanks


--
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.


Rossko

unread,
Jan 18, 2011, 3:52:12 PM1/18/11
to Google Maps JavaScript API v3
> My problem is that markers appears in one map but not in two maps
> simultaneously.

No need to hijack unrelated threads, you have already started a new
one for yur two-map problem
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/798676ef1ef0de26

kalyan

unread,
Jan 19, 2011, 10:17:54 AM1/19/11
to Google Maps JavaScript API v3

Hi Larry,

Thanks for your reply. I already done mouseover event in my
application. I need same functionality on click. Please check my
application here http://174.129.38.115:8105/.



On Jan 19, 1:11 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Jan 18, 9:47 am, kalyan <kalyan.allampa...@gmail.com> wrote:
>
> > Is there any way to change gmap marker icon while onclick and get back
> > its original icon while clicking another marker or map. Suppose, In my
> > gmap, I'm showing events in different colors(icon's). while clicking a
> > marker the icon should change to yellow and should get back its
> > original color when clicking another marker on the map. Thanks in
> > advance..
>
> Something like this?http://www.geocodezip.com/v3_MW_example_hoverchange.html

geoco...@gmail.com

unread,
Jan 19, 2011, 11:48:25 AM1/19/11
to Google Maps JavaScript API v3
On Jan 19, 7:17 am, kalyan <kalyan.allampa...@gmail.com> wrote:
> Hi Larry,
>
> Thanks for your reply. I already done mouseover event in my
> application. I need same functionality on click. Please check my
> application here
http://174.129.38.115:8105/

That site is not accessible (at least for me).

Change the listener to listen for the click event rather than the
mouseover/mouseout events.

-- Larry

>
> On Jan 19, 1:11 am, "geocode...@gmail.com" <geocode...@gmail.com>
> wrote:
>
>
>
> > On Jan 18, 9:47 am, kalyan <kalyan.allampa...@gmail.com> wrote:
>
> > > Is there any way to change gmap marker icon while onclick and get back
> > > its original icon while clicking another marker or map. Suppose, In my
> > > gmap, I'm showing events in different colors(icon's). while clicking a
> > > marker the icon should change to yellow and should get back its
> > > original color when clicking another marker on the map. Thanks in
> > > advance..
>
> > Something like this?http://www.geocodezip.com/v3_MW_example_hoverchange.html
> > (changes the markers on mouseover not click, ported from Mike
> > Williams' v2 example)
>
> >   -- Larry- Hide quoted text -
>
> - Show quoted text -

Durval Henke

unread,
Jan 19, 2011, 3:50:27 PM1/19/11
to google-map...@googlegroups.com
count the numbers of markers
or put the markers in array
and set on event click
the marker[i].setIcon(old icon)
add the new marker
Henke

2011/1/18 kalyan <kalyan.a...@gmail.com>
Reply all
Reply to author
Forward
0 new messages