Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Simple Google Maps

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 5753 Views
  • spenniec
    Avatar
    Community Member
    37 Posts

    Re: Simple Google Maps Link to this post

    Hi
    One thing that stands out is that there are 2 script tags for the api and your key.
    This one is incorrect
    <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;keyABQIAAAAs9hPF45AQw42f-3VhD_y4hT55LS6GbizrBzE_RUb_NV-rrad3RRxsRhQ5PCE_NiieNdRPNw2cS398g"></script>

    as it is missing the '=' sign after key. Is this in your template file?
    Spence

  • PaweÅ‚ PierzchaÅ‚a
    Avatar
    Community Member
    5 Posts

    Re: Simple Google Maps Link to this post

    First thing: spenniec - you did really good job

    I had the same problem - the map didn't show up... but now it works
    Tho only thing you have to do is add <body onload="load()" onunload="GUnload()">

    so my code looks:
    ...
    <body onload="load()" onunload="GUnload()">
       $GetGoogleMapsScript
       <div id="Map" style="width: 500px; height: 300px"></div>
    </body>
    ...

    that's it

  • potion_maker
    Avatar
    Community Member
    36 Posts

    Re: Simple Google Maps Link to this post

    Speniec,
    Sorry I didn't post a thank you sooner. Your advice was very helpful. You were right I was missing the '=' sign. Silly mistake. Anyway thanks again!

  • potion_maker
    Avatar
    Community Member
    36 Posts

    Re: Simple Google Maps Link to this post

    So i figured out a way around this once before but recently updated my silverstripe build to 2.2.3 and am having the problem again. My map works fine in IE7 but won't show up in FF or Safari. It seems like there is an issue with a double quote in the wrong place or something. I'm just wondering if anyone else has had a similar problem when dealing with the gMapPage.php spenniec provided. You can see what I'm working on at jazzat5.org/site/location/. If you check out the source you'll see FF shows all of the script code in pink.

    I've copied the code from the view source page FF creates and plugged/posted it as a .html page. When I view it the map it shows up. There is literally no change between the code generated and read by FF the first time or the code works.

    Any thought would be greatly appreciated. Also Spenniec, your example link http://www.mccauleys.co.nz/ no longer works. It turns up the following error:
    Fatal error: Class 'Page' not found in /home/.mummy/cms_dc/2.2.1/cms/code/PageTypes/UserDefinedForm.php on line 3

    5753 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.