Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

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

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

Simple Google Maps


Reply

12 Posts   5883 Views

Avatar
spenniec

30 August 2008 at 4:59pm Community Member, 37 Posts

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

Avatar
Paweł Pierzchała

25 September 2008 at 8:20pm Community Member, 5 Posts

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 :)

Avatar
potion_maker

10 October 2008 at 1:14pm Community Member, 36 Posts

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!

Avatar
potion_maker

26 November 2008 at 11:49am (Last edited: 26 November 2008 4:36pm), Community Member, 36 Posts

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