Re: How to trigger Weather Layer marker click?

287 views
Skip to first unread message

Enoch Lau (Google Employee)

unread,
Jul 7, 2012, 6:17:38 AM7/7/12
to google-map...@googlegroups.com
Unfortunately, it isn't possible to programmatically open a weather layer info window. If you'd like to see this in the API, please file a feature request: http://code.google.com/p/gmaps-api-issues/issues/list

Enoch

On Saturday, July 7, 2012 11:24:34 AM UTC+10, Jorge Barata González wrote:

Hi,

I am trying to trigger a click on the Weather Layer of a google maps instance in order to open the weather info window of a city:

//Create the map
var options = {
  center: new google.maps.LatLng(49.265984,-123.127491),
};
var map = new google.maps.Map(document.getElementById("map_canvas"), options);

//Create the weather layer
var weatherLayer = new google.maps.weather.WeatherLayer();
weatherLayer.setMap(map);

//Create the event, how?
var event = ?;

//Trigger the click
google.maps.event.trigger(weatherLayer, 'click', event);

The problem is the event that I have to pass to the trigger function. It must be an instance of WeatherMouseEvent. This instance is created by the layer when the user clicks on one of its markers, and I don't know how to generate this event.

Thanks!

Reply all
Reply to author
Forward
0 new messages