Summary: Talk Page for GMap recipe
Maintainer: Petko

Your comments are welcome. Please post new comments at the bottom of this page.

Hi Petko. I'm having trouble with maps that don't have a specific ll=.... For instance, i have a map that is for a town/zipcode:

... and when GMap replaces the code, it returns nothing but the zoom factor: [[GMap:z=13]]

in addition, i have a personal google map:

... and when GMap replaces the code, it again returns something that breaks:


is there a way to embed these kinds of maps with GMap? and a way for the ROEPattterns to successfully convert them from their natural state?

overtones99 October 18, 2009, at 07:55 PM

With both locations, if you just move the map a little, or zoom in-out, then the links will obtain a ll= parameter and the GMap should display fine. The latest version 20091022 will use an existing sll= parameter if the link doesn't have the required ll= parameter. About the personal multimap (the first one I see!), there are two problems: without the ll= parameter it doesn't work, but with it, it displays an additional red pin on that location. I'll try to fix it as soon as possible. (Should be fixed from 20091025.) --Petko October 21, 2009, at 06:18 PM

hi petko thanks for your work on the gmap recipe. it's fun to play with! and thanks for addressing my recent questions.

here are some more comments and questions:

  • your suggestions (& the new recipe) worked - thanks!
  • i see what you're talking about with the extra center pin showing up on personal maps. i look forward to that disappearing : )
Until I fix this, you can remove the center pin by adding a "nomarker" title, like GMap:ll=...&msid=..."nomarker". You still need the ll= parameter though. Should work from version 20091025.
  • it took me awhile to figure it out, but these maps are very persnickety, and can malfunction very easily when other maps are on the same wikipage - i.e. an error in one very often short-circuits the rest. for instance i fiddled with the personal multimap for over an hour (which wasn't working), and it didn't start to work until i finally removed other test maps from the page. i don't know what changed, or what the situation was, but i had run into a similar problem a couple days before, and thought i had "solved" the earlier problem and could continue working simultaneously with these test maps. i wonder if you've run into the same problems? if so, perhaps the recipe page could use a note suggesting only working on one map at a time to prevent problems?
The recipe should work with more than one map in a page, and an error in one shouldn't break the others. There shouldn't even be "an error in one", errors should be prevented -- if you have maps with errors, please show them to me, or better, add them to my sandbox for investigation.
  • for some reason the current method of designating a list of points with %gmap% took a long time to click for me, and i foresee users of gmap on my site(s) probably running into the same problem. i wonder if it's possible to instead wrap the pins in a >>gmap<< instead? so, instead of:
     : %gmap% GMap:ll=33.966142,-117.965698&z=8 : center & zoom of entire map
     : GMap:ll=34.170038,-118.047581&z=16 : # 1
     : GMap:ll=34.187613,-118.131244&z=16 : # 2
maybe something like this:
     : GMap:ll=33.966142,-117.965698&z=8 : center & zoom of entire map
     : GMap:ll=34.170038,-118.047581&z=16 : # 1
     : GMap:ll=34.187613,-118.131244&z=16 : # 2
... not sure if this is possible, but it just visually makes more sense to me when i'm starting out from scratch...
This is currently not possible without complexifying the code too much.
  • with the following map (for the white house), is it possible to automatically display the google-pin-info without having to type it in? for instance, the pin on google reads:
	White House
	1600 Pennsylvania Ave NW
	Washington, DC 20500-0004
	(202) 456-1414
is it possible to get this google pin info to display automatically?
No, this is not possible. Couldn't you just copy and paste the text you want?
of course, but it'd be amazing to be able to tap that wealth of info (which might update over time) that's already sitting there, whether placed by businesses or by users. it would prevent unnecessary typing, and also allow for info that is updated or added to predefined points. is this a limitation of google, or of this recipe?
The recipe does nothing specific to "limit" this, you are asking for a new, nonexistent feature. At the moment, I have no time to research if it is possible, to work on implementing it, and to support it. GMap is not meant to support all possible features, maybe GoogleMapAPI could suit you better?
  • and finally, i know this may be like asking for too many bells and whistles, but i'm just thinking ahead to user-questions/frustration on my pages - i wonder if the ROEPattern could somehow detect that someone's adding a pin to a map, and then provide the :list:definition: markup instead? (sorry if this is too much to ask for!)
so that:
     : %gmap%GMap:ll=33.966142,-117.965698&z=8 : center & zoom of entire map
     : GMap:ll=34.170038,-118.047581&z=16 : # 1
     : GMap:ll=34.187613,-118.131244&z=16 : # 2
turns into:
     : %gmap%GMap:ll=33.966142,-117.965698&z=8 : center & zoom of entire map
     : GMap:ll=34.170038,-118.047581&z=16 : # 1
     : GMap:ll=34.187613,-118.131244&z=16 : # 2
     : GMap:ll=38.904459,-77.036562&z=14 : #3
No, because an author may actually want to add a second map in the page. I use the Preview button a lot, so I can see if the page is or isn't like I want. --Petko October 24, 2009, at 04:18 AM
but i wonder, if you're creating a 2nd map on the page, there are usually 2 indicators that previous maps are done: 1) newline(s), and 2a) the %gmap% located in the first line or 2b) a bare Gmap: indicator. seems like there could be a simple ROE rule to differentiate. maybe i'll look into it...
Please do. You can add your own $ROEPatterns in config.php.
btw, my concerns about these are based on the non-wiki users that frequent my sites. most are happy to try things out, but aren't interested in spending a couple hours figuring things out like i did last night. they also don't ask questions when they run into problems - they stop. so my personal style is to try and make it even simpler on the surface (which may lead to more complexity underneath). just wondering aloud if there are some ways to make this even more intuitive... thanks overtones99 October 24, 2009, at 02:29 PM
If the instructions ("go to [3], find your location... zoom in and double click... copy the link") were so unclear that you spent hours to make it work, then the recipe or the docs need fixing. :-)
obviously that was the cinchy part. it was everything after that, with maps malfunctioning that was cause for consternation... (plus experimenting to try and see if one could get google info to pop up)... i'll look to see if i can reproduce the more random errors...
I didn't know about the personal multimaps, I'll try to find some time to implement this feature correctly, but that's about all my plans. Non-wiki users unwilling to read a paragraph of the documentation are not the intended audience of this recipe.
i realized while driving home that i might try my hand at writing some FoxForms & FoxFilters to enable non-wiki addition and editing of points. might work very nicely, keeping extra clutter out of the recipe. if i do, i'll add some documentation here.
Note that you may be able to show whatever the map displays on Google with the second link starting with <iframe -- see the EnableHTML, IncludeUrl and IncludeSite recipes. And again, the GoogleMapsAPI recipe has probably all the features a person may need. --Petko October 24, 2009, at 05:00 PM

thanks petko! overtones99 October 24, 2009, at 10:19 PM

Hi, I wanted KML support. KML lets you add information to maps, like curves. It turns out KML support is in the javascript, it just needs enabling with markup.

I added these lines to cookbook/gmap.php

$LinkFunctions['GMapKML:'] = 'LinkIMap'; $IMap['GMapKML:'] = '$1'; $IMapLinkFmt['GMapKML:'] = "<a class='gmaplink' title='kml' href='\$LinkUrl' rel='nofollow'>\$LinkText</a>";

after the ones that set up the GMap markup.

Then in my wiki page I can have:

: %gmap% GMap:ll=54.454073,-3.015747&z=9 : center & zoom of entire map
: GMapKML: :

where the second line contains the URL of my KML file and adds it to the map.

HTH, David Pilling

Talk page for the GMap recipe (users?).