On Jul 20, 9:55 am, kentuky <[email protected]> wrote:
> Thank for the very kind help... but it is so tricky.......
>
> Now i try the following without success:
define success.
GDownloadUrl(tab1, function(html,responseCode) {
content1 = html;
}); // end of callback
GDownloadUrl(tab2, function(html,responseCode) {
content2 = html;
}); // end of callback
This happens before either callback function has run... so content1
and content2 are not defined...
var infoTabs = [
new GInfoWindowTab("Übersicht", content1),
new GInfoWindowTab("Öffnungszeiten", content2)
];
//Erzeugen des Markers mit Icontype als Bild
var marker = createMarker(point,label,icon,infoTabs);
map.addOverlay(marker);
> ------------------------------------------------
>
> Any ideas ?
I get a javascript error "nodeType is null or not an object"
-- Larry
>
> On 20 Jul., 18:09, Rossko <[email protected]> wrote:
>
>
>
> > > Therefore it is not possible to call a html Site in an Tab but in an
> > > infowindow it works ?
>
> > It's possible,but you need to do things in the right order.
>
> > GDownloadUrl is asynchronous
> > http://econym.org.uk/gmap/async.htm
>
> > Looking at your code
> > GEvent.addListener(marker, "click", function() {
> > GDownloadUrl(tab1, function(html,responseCode) {
> > content1 = html;}
> > .....
> > marker.openInfoWindowTabsHtml([new GInfoWindowTab(...
>
> > An anonymous function is defined to be executed on marker click, so
> > far so good.
> > When clicked and executed, GDownloadUrl() is called. This fires off a
> > request for the data - that's all. The data will take ages to come
> > back, in javascript terms.
> > Meantime the code doesn't stop, it carries on.
> > Eventually it gets to the openInfoWindowTabsHtml(), but the data still
> > isn't available so broken tabs are created.
> > Ages later, the data appears at the browser, the download callback is
> > executed, and the variable 'content1' is set.
> > Nothing else happens with 'content1', because the open infowindow
> > business finished (badly) long ago.
>
> > You can only use asynchronous data after it is available. You don't
> > know when it will be available, so you have to use the 'callback'
> > function which is automatically run when the data really is available.
>
> > Skeleton code
> > GEvent.addListener(marker, "click", function() {
> > GDownloadUrl(tab1, function(html,responseCode) {
> > content1 = html;
> > marker.openInfoWindowTabsHtml( use content
> > here)
> > } // end of callback
> > } //end of click listener
>
> > The difficulty that you will face is that you need to get multiple
> > asynchronous calls to assemble _all_ your data, before opening the
> > infowindow.
>
> > An alternative approach that might work better is to open your tabbed
> > infowindow at the click, but populate it with some dummy data. Fire
> > off your GDownloadUrls and set each ones callback up to update the
> > dummy data in the existing tabs into the real data, as it becomes
> > available.
>
> > This stuff isn't easy.- Hide quoted text -
>
> - Show quoted text -
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.