map and confirn message

37 views
Skip to first unread message

Nico Oudshoorn

unread,
Jun 23, 2011, 1:28:41 PM6/23/11
to google-map...@googlegroups.com
on this page http://www.rideshare.nu/ritinvoerenV3.php?codet=en fill in as from city rottum. There are several places called rottum. So the page will show place after place if you click cancel. But the map where that place is wil not be shown? Only when there is just one place or if you click ok than the map with the place is shown. Question is, why is the map in the other cases not shown?
 
Any suggestions.

geoco...@gmail.com

unread,
Jun 23, 2011, 1:59:58 PM6/23/11
to Google Maps JavaScript API v3
On Jun 23, 10:28 am, Nico Oudshoorn <n...@meerijden.nu> wrote:
> on this pagehttp://www.rideshare.nu/ritinvoerenV3.php?codet=en<http://www.rideshare/ritinvoerenV3.php> fill
> in as from city rottum. There are several places called rottum. So the page
> will show place after place if you click cancel. But the map where that
> place is wil not be shown? Only when there is just one place or if you click
> ok than the map with the place is shown. Question is, why is the map in the
> other cases not shown?

Why should it be? Every time the user chooses "Cancel" you call
hideMap() and your code has no way to know where to center the map.

-- Larry

>
> Any suggestions.

Nico Oudshoorn

unread,
Jun 23, 2011, 3:17:27 PM6/23/11
to google-map...@googlegroups.com
Why should it be? Because before you choose ok or cancel in the confirm message you want to see the place to choose on the map!

geoco...@gmail.com

unread,
Jun 23, 2011, 5:11:37 PM6/23/11
to Google Maps JavaScript API v3
On Jun 23, 12:17 pm, Nico Oudshoorn <n...@meerijden.nu> wrote:
> Why should it be? Because before you choose ok or cancel in the confirm
> message you want to see the place to choose on the map!

You need to write the code to do that. My point was that it won't do
that unless you write the code so that it does.

My suggestion would be to add all the locations returned to the map
and let the user choose one or do a list like this (v2) example in
Mike Williams' tutorial:
http://econym.org.uk/gmap/didyoumean.htm

-- Larry

Nico Oudshoorn

unread,
Jun 24, 2011, 12:54:49 PM6/24/11
to google-map...@googlegroups.com
I know your suggestion. I have that already working on this page http://www.meerijden.nu/allerittenmaps2.php?ga=a&codet=en. But on the other page I had a different solution. In an early V2 version it was working, but the empty map I discovered later. Now I am transforming to V3 and want to have it working. What I don't understand ia what you mean with I have to write the code. Because all the code is there already. Only the map doesn't show up. The execution of the code isn't finisched at the moment of the confirm? Something wrong with my logic?
 
Nico.

Rossko

unread,
Jun 24, 2011, 3:16:32 PM6/24/11
to Google Maps JavaScript API v3
> Because all the code is there already. Only the map doesn't
> show up.

Which browser? I do get a series of maps in FF2 offering choices for
'rottum'.

In IE your 'confirm' stops the browser before it has finished
rendering the map. You could allow the map to be created and rendered
before calling confirm, or you could use some other yes/no selection
method ... like the didyoumean example does.

Your method of creating a new map object for every choice is a bit
suspect ; better to re-use the same map by repositioning. Probably
quicker rendering as well.

There is an error on page unload, because you still have GUnload in
use (this is not part of v3)

Nico Oudshoorn

unread,
Jun 25, 2011, 9:59:31 AM6/25/11
to google-map...@googlegroups.com
This suggestion of you (Your method of creating a new map object for every choice is a bit
suspect ; better to re-use the same map by repositioning.  Probably
quicker rendering as well.) I changed the code. I have written the load and unload in the body and made a loadmap2 function. So the map is created and rendered. So now only the marker must be placed and the map centered. But still I get the same result. I hope the error you mentioned about the unload has disappeared as well. I don't see an error. 
 
Is it possible to wait for the end placing themarker and center the map before the conform starts?  
Nico.

Rossko

unread,
Jun 25, 2011, 11:35:16 AM6/25/11
to Google Maps JavaScript API v3
> I hope the error you mentioned about the unload
> has disappeared as well.

Won't disappear unless you take some action about it
<body onload="loadMap();" onunload="GUnload()">

> Is it possible to wait for the end placing themarker and center the map
> before the conform starts?

There is no 'map complete' event, but there is something close you
could try:
http://groups.google.com/group/google-maps-js-api-v3/search?group=google-maps-js-api-v3&q=tilesloaded

Nico Oudshoorn

unread,
Jun 27, 2011, 10:59:01 AM6/27/11
to google-map...@googlegroups.com
Thanks. The map complete examples I try. But what to do with the error I don't know? Do you have a suggestion?
Reply all
Reply to author
Forward
0 new messages