I concur. The side panel was a very useful tool and while I can adapt my maps to the new API code relatively easily, I'm not as easily going to be able to create my own side panel whose links will automagically expand the minipages of my plotted points.
While it doesn't seem that said side panel is built in to the GMap
objects, _MapsApplication still exists. Additionally, a
GMapsApplication object has been added. GMapsApplication is simply
another name for _MapsApplication, just as GMap is for _Map. It may
have changed somewhat, but it still exists. A bit of wading through the
source should allow you to figure out how to use it.
Elyscape wrote: > While it doesn't seem that said side panel is built in to the GMap > objects, _MapsApplication still exists. Additionally, a > GMapsApplication object has been added. GMapsApplication is simply > another name for _MapsApplication, just as GMap is for _Map. It may > have changed somewhat, but it still exists. A bit of wading through the > source should allow you to figure out how to use it.
It is worth pointing out that if it isn't listed in the doc, then
don't count on it not changing over time. This is why we are
presenting an API layer, so that you folks can create reliable
websites.
> While it doesn't seem that said side panel is built in to the GMap
> objects, _MapsApplication still exists. Additionally, a
> GMapsApplication object has been added. GMapsApplication is simply
> another name for _MapsApplication, just as GMap is for _Map. It may
> have changed somewhat, but it still exists. A bit of wading through the
> source should allow you to figure out how to use it.
Swapping in GMapsApplication makes everything work just as before.
I hope that Google does decide to present something like GMapsApplication as part of the official API; it's so extremely useful. I'm sure many of us could write our own copy of this, but the functionality here seems to have such a high reusability potential (and makes neat applications so easy!) that it'd be a shame to force us to write our own.
> Elyscape wrote:
> > While it doesn't seem that said side panel is built in to the GMap
> > objects, _MapsApplication still exists. Additionally, a
> > GMapsApplication object has been added. GMapsApplication is simply
> > another name for _MapsApplication, just as GMap is for _Map. It may
> > have changed somewhat, but it still exists. A bit of wading through the
> > source should allow you to figure out how to use it.
Maybe I should have mentioned I've only bothered to get my maps running
at all on Firefox? I have div / CSS issues with IE, I'm pretty sure,
and as I'm working on a very low-traffic personal site, and none of my
friends use IE, I haven't bothered to figure it out yet. Are you
getting blank pages on Firefox?
Yeah, I'm reluctant to use GMapsApplication since it isn't documented.
It wouldn't actually be that much JavaScript to add to the "Display Info Windows Above Markers" example. In the createMarker function where it adds a listener to the marker, you'd also add a line of HTML to the side panel container, with a link whose href does a JavaScript call to openInfoWindowHtml().
By the way, can someone explain why that example works when the addListener() call is in a function but stops working right if the call is inlined? Does this have something to do with the comment about "function closures"?
Yes, when you create an event handler inline like we do in the
example, it inherits the context of the _function_ in which it was
called, not the values of the variables at the time it was called. See
Basically, if you create event handlers like the example, you should
call a function for each marker so that the value for "marker" is
correct in the event handler.
Bret
On 6/29/05, Jef Poskanzer <jef.poskan...@gmail.com> wrote:
> Yeah, I'm reluctant to use GMapsApplication since it isn't documented.
> It wouldn't actually be that much JavaScript to add to the "Display
> Info Windows Above Markers" example. In the createMarker function
> where it adds a listener to the marker, you'd also add a line of HTML
> to the side panel container, with a link whose href does a JavaScript
> call to openInfoWindowHtml().
> By the way, can someone explain why that example works when the
> addListener() call is in a function but stops working right if the call
> is inlined? Does this have something to do with the comment about
> "function closures"?
>it inherits the context of the >_function_ in which it was called, not >the values of the variables at the >time it was called.
Yeah, that's what I figured. I could make a pretty good argument that this is yet another case of JavaScript being deeply incorrect, but this is not the right place for that discussion.
Great job Jeff!!! I've tried to cut and paste your code but with no luck. Would you be willing to share a quick "how to" with the rest of us on how to get the shell of your idea up and running?
Jef Poskanzer wrote: > Ok! I have updated my little sample app to include a working side > panel. It uses only the current documented API calls. Check it out:
Since I'm already pulling from a data-filled XML file, I think any additional functionality from this point forward will be stuff I'm already familiar with.
> > Elyscape wrote: > > > While it doesn't seem that said side panel is built in to the GMap > > > objects, _MapsApplication still exists. Additionally, a > > > GMapsApplication object has been added. GMapsApplication is simply > > > another name for _MapsApplication, just as GMap is for _Map. It may > > > have changed somewhat, but it still exists. A bit of wading through the > > > source should allow you to figure out how to use it.
Thanks from me, too, Jeff; I have a couple of my maps back up on my site (one at http://www.williamsburger.com/wb/bedford-ave-williamsburg), and with this version of the API, it works on both Firefox and IE, while I could never convince the GMapsApplication code to run under IE.
I decided to ditch the XML files and rebuild my entire platform based on a couple MySQL DB tables, so the XML part went away for me, and now mine's all PHP and JavaScript.
I had a chance to play with my side-panel sample code on Safari yesterday. Actually the first thing I did was verify that Google Maps and Google Local do work on this setup. Then I looked at my own app, http://www.acme.com/jef/paris_forts/ - and I noticed two specific problems.
1) The popup info boxes do not show up, neither from the side panel links nor from the main map panel markers. I didn't try the Maps API doc page's info box examples to see if they work, should have done that.
2) The accent characters in the side panel show up as literal HTML entity strings, with the ampersand and semicolon showing. This is interesting because to get those accents working in Firefox and MSIE I had to escape them - in my code I have stuff like ampersand amp semicolon eacute semicolon. If I don't escape the accent entities in Firefox and MSIE, the app doesn't even load.
Anyway, when I get a chance to do a longer debugging session on Safari and try some more things, I'll post again.
I had similar problems with escape characters. I used the javascript escape character of backslash to get my stuff working... Maybe that could help?
I will look at your code a little more today and see if my newbie eyes catch anything. Thanks for your hard work and dedication. It is a HUGE help to me.