Detecting clicks on places

142 views
Skip to first unread message

Gustavo Ambrozio

unread,
Sep 27, 2011, 11:43:37 PM9/27/11
to Google Maps JavaScript API v3
I'm building a custom map and I'd like to provide my own info windows.

Everything works on my custom markers, but if you zoom a lot you can
see some places icons. If you click on those you still get the default
info window.

I'd like to capture the event that triggers this info window and
provide my own info window. How can I do this?

To see what I mean, go to this sample:

http://gmaps-samples-v3.googlecode.com/svn/trunk/map_events/map_events.html

Click on the airplane icon that appears over the airport on the top
right corner and it will open the info window for the airport.

Can I intercept this event and provide my own info window?

Any help is appreciated.

Thanks in advange

Pil

unread,
Sep 28, 2011, 7:11:59 AM9/28/11
to Google Maps JavaScript API v3
No, unfortunately you can't.
You can't even close the default info window when toggling the POIs
and an info windows remains open.

What you can do is, not to display the clickable POIs. That's the only
way I Know of to avoid the default info window.




On Sep 28, 5:43 am, Gustavo Ambrozio <gust...@getarrived.com> wrote:
> I'm building a custom map and I'd like to provide my own info windows.
>
> Everything works on my custom markers, but if you zoom a lot you can
> see some places icons. If you click on those you still get the default
> info window.
>
> I'd like to capture the event that triggers this info window and
> provide my own info window. How can I do this?
>
> To see what I mean, go to this sample:
>
> http://gmaps-samples-v3.googlecode.com/svn/trunk/map_events/map_event...

Gustavo Ambrozio

unread,
Sep 28, 2011, 3:11:21 PM9/28/11
to Google Maps JavaScript API v3
Thanks for the reply. How can I hide these clickable POIs then?

Pil

unread,
Sep 29, 2011, 3:06:35 AM9/29/11
to Google Maps JavaScript API v3


On Sep 28, 9:11 pm, Gustavo Ambrozio <gust...@getarrived.com> wrote:
> Thanks for the reply. How can I hide these clickable POIs then?


This will disable all pois

new google.maps.Map(mapDiv, {
center: new google.maps.LatLng(...),
zoom: ...,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [
{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
}
]

});

Have a look at the reference for disabling/enabling certain types

http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeStyle


Gustavo Ambrozio

unread,
Sep 29, 2011, 12:43:15 PM9/29/11
to google-map...@googlegroups.com
Thanks a lot for this! Solved my problem.

Cheers,
Gustavo



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


As mina pira

unread,
Feb 20, 2012, 6:06:41 PM2/20/12
to google-map...@googlegroups.com
Thank you ! You help me so much ! 
Reply all
Reply to author
Forward
0 new messages