Embedding a javascript google guestmap: how to fire an onload (5 posts)

  1. digitaltoast
    Posted 9 years ago #

    I'm trying to embed this guestmap:
    http://www.thompsonbd.com/guestmap.php into WordPress 2.0.4

    To this end, I've read all of the below and many more in the last couple of days:
    (the method mentioned in the last link was too ugly and stopped working after the guestmap was updated for API V2)

    So, the closest I could come up with was:
    which is just a modified version of the plugins template.
    It can be seen in non-action at:

    The map loads fine, but try as I might (and oh, how I've tried!) I can't get the javascript and
    <body onload="onLoad()" onunload="GUnload()">
    parts to go in the right place.

    I've tried my best to learn on my own, but I think there's something fundamental about page wrapping I'm not understanding, and I'd greatly appreciate the assistance.

  2. Les Bessant
    keeper of the Tiggers
    Posted 9 years ago #

    I think you're close...

    The page template has a Get_header() call. This pulls in the standard header.php from your template. This (probably) includes a <body> tag. As your page template includes its own <body> tag (with the script), this isn't going to work.

    How about copying the contents of your header.php into your template, remove the get-header(), remove the extra <body> and try that?

  3. You also call get_header() twice in that template, which most definitely will not work.

    Probably your best bet is to eschew the get_header call entirely and copy the header in yourself. Not the best way to do things, but it would work for a one-shot deal.

  4. digitaltoast
    Posted 9 years ago #

    Well, I've done all the above, spent a couple of weeks with a headache, going to give up and ask for help again!

    The embedded guestmap is showing in Firefox but not clickable, but not in IE at all, but is giving a javascript error "pdmarker is not defined", and points me to this bit of code:

    var point0 = new GLatLng(53.33087298301704, -1.0546875);
    448 var marker0 = new PdMarker(point0, icon);

    You can see the problem at:

    It would be a shame to abandon it altogether - perhaps someone more skilled than me could make a proper WordPress plugin out of it? Where would I suggest this kind of thing?

  5. digitaltoast
    Posted 9 years ago #

    Well, it's been 7 months. That developer has kind of given up on it and I'm looking for a decent Google Maps based guestmap, even if it can't be embedded in WordPress.
    I don't want to use an externally hosted on because they either disappear, or suddenly start flooding you with adverts!

Topic Closed

This topic has been closed to new replies.

About this Topic