Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #23988

Displaying infoWindow onload or onclick?

From Tuxedo <tuxedo@mailinator.com>
Newsgroups comp.lang.javascript
Subject Displaying infoWindow onload or onclick?
Date 2014-04-29 18:27 +0200
Organization albasani.net
Message-ID <ljojta$15t$1@news.albasani.net> (permalink)

Show all headers | View raw


The below code is part of gmap v3 whereby clicking on one of several pins 
on a typical google map will pop up an info-window at the pointer. The 
function is part of a larger code block with various display options:
 
var onMarkerSomewhere = function() {
var marker = this;
var latLng = marker.getPosition();
infoWindow.setContent('hello');
infoWindow.open(map, marker);
};

var Somewhere = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(-36.874638, 49.847593)

});

google.maps.event.addListener(Somewhere, 'click', onMarkerLocation);

I would like to launch the info-window from an external link elsewhere on 
the page or at onload of the document. It's basically the 
'onMarkerSomewhere' that needs to run in another situation than the onclick 
of the marker itself. How would the function call be constructed to run for 
example in an onclick or in a subsequent part of the code block?

Many thanks for any pointers!
Tuxedo

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Displaying infoWindow onload or onclick? Tuxedo <tuxedo@mailinator.com> - 2014-04-29 18:27 +0200
  Re: Displaying infoWindow onload or onclick? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-04-29 20:46 +0100
    Re: Displaying infoWindow onload or onclick? Tuxedo <tuxedo@mailinator.com> - 2014-04-29 23:12 +0200
  Re: Displaying infoWindow onload or onclick? Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2014-04-30 20:46 +0800

csiph-web