[pmwiki-users] Announcement: Google Map API v.2.0.0--Hot off the press

Ben Wilson dausha at gmail.com
Wed Aug 23 09:06:33 CDT 2006


On 8/23/06, Hans <hans.bracker at googlemail.com> wrote:
[snip]

> Although there is a lot of description documenting the recipe, I am
> missing examples.
> I learn best by seeing example code, put precisely, which I then can adapt.
> Example configuration code also helps me to understand the concepts behind.

There are example points and line-points on the Cookbook page embedded
with the documentation. Perhaps I should make them stand out better as
the are rather obscure. Once those interested have come back with
bugs/suggestions, I was going to build a suite of pages with examples.

> For instance I was confused reading about the installation. It
> mentions require_once(..), where we always use include_once. And when
> installing the main script in farm/cookbook/ the javascript needed
> putting into the field/pub/scripts/ folder, because gma-2.0.0.php uses
> $PubDirUrl and not $FarmPubDirUrl.

include_once() == require_once() except that include_once() gets
tricky when using Win32.[1] So, this argues symantics. I believe I
always use require_once().

The $FarmPubDirUrl is easily changed in a bug-fix release. This is
another example where I never use $FarmPubDirUrl, despite my having a
rather expansive wiki plantation. I'll add that to the TODO for 2.0.1

> I was also not too pleased that I needed to make changes to the skin
> template, just to get this recipe running. But I have to think about
> this a bit more, to see if there is another more general way to
> include code at the bottom of the html page. Probably by redefining
> and adding a variable to $HTMLEndFmt, as an array similar to
> $HTMLHeaderFmt.

You have _always_ needed to change the skin with this recipe. I have
tried to get around this, however HTMLEndFmt does not seem to work
when there is a skin. I have worked with others to see if there's a
way around this. However, editing a skin is a minor inconvenience in
light of what is provided. I use PmWiki's auto-populating arrays as
much as possible.

> Finally having the installation working and a map displayed, I found
> that I could not set a center and zoom level to the map. Where and how
> does one set the maps center with lat and long coords? I needed to
> hack the pub/scripts/gmaJs.js file
> to change coordinates. And from where is the js 'load' function called?

You shouldn't be hacking the gmaJs file. The whole purpose of that
file is to provide a library of functions to conserve bandwidth.

If you RTFM, you'll see that the default behavior of the GMA is to
auto-zoom/center the map on the points given. However, you're supposed
to be able to set the zoom level both via markup and configuration.
Inspecting the code, I see I left that out. I will release 2.0.1 with
this fix.

There is no javascript load function. Researching the API showed no
need for it, and I do not recall finding an example where a load
function was used. The maps are self-loading.

2.0.1. TODOs:
$FarmPubDirUrl
fix configurable zoom.

I'll release this later today if I don't get other input for other bug fixes.

[1]: C.f. http://php.net/require_once with http://php.net/include-once

-- 
Ben Wilson
"All this worldly wisdom was once the unamiable heresy of some wise man." HDT




More information about the pmwiki-users mailing list