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.


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

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

Google Mapping questions


8 Posts   2849 Views


13 July 2007 at 1:07pm (Last edited: 13 July 2007 1:23pm), Forum Moderator, 628 Posts

Ofir, can you explain why you need to force [url=]dev mode[/url] and disable the content negotiator in the google maps _config.php?

I'm going to remove devmode but perhaps leave contentneg in, for the preliminary 0.1 release... ?

I'll also remove the API key so that much of the code is disabled until you actually enter in a key. Since the one you bundle will never work for anyone else. This makes the _config.php like this:

// Enter your free GoogleMaps API key from
$GMaps_API_Key = '';
* TODO: Need a better place to handle this. We should be able to set that from
* the sites _config.php file rather than in here



13 July 2007 at 3:26pm (Last edited: 13 July 2007 3:27pm), Forum Moderator, 628 Posts

Seems to work for me, so I've uploaded. I then did the following to test the release was sweet. Please let me know if anyone finds a problem!

Note that forum0.11 adds support for googlemaps, the 0.1 release will function as a forum but not show any google maps.


tar xzf
cd silverstripe-v2.0
tar xzf ../maps-0.1.tar.gz
tar xzf ../forum-0.11.tar.gz

Add API to to maps/_config.php, get one from

chmod g+w .htaccess tutorial mysite assets

( visit the installer )

( go into cms and add a "ForumMemberMap" page)


13 July 2007 at 4:18pm (Last edited: 13 July 2007 4:18pm), Forum Moderator, 628 Posts

Ofir, you're requirement of:


Stuffs up the CMS login page. This will be partly solved by only including it on pages where googlemaps are included. (This affects the version of the code that is now for public download, so please fix and commit to SVN :) )

Secondly, I noticed that Requirements::javascript() needs to produce XML-safe code; as it stands if you remove your phrase "Requirements::javascript("".$GMaps_API_Key);" then you get an XML-not-well formed error on the equals sign.


13 July 2007 at 4:39pm Forum Moderator, 628 Posts

See attached


14 July 2007 at 4:42pm Google Summer of Code Hacker, 222 Posts

Good job Ofir! Keep up the great work!

I tested maps-0.1 with silverstripe-v2.0.2-rc3 and forum-0.11 on Apache 1.3.37 (Unix), MySQL 5.0.27-standard, and PHP version 5.2.3 and everything works great.

It would be cool to be able to select a more specific location on the map by clicking on a specific point or by choosing a state. But I'm sure stuff like that is planned for later. :)

Have a great weekend,



15 July 2007 at 12:07am Forum Moderator, 628 Posts

Instead of only dragging it, you mean? I just want to confirm that you were able to move your map point ....


15 July 2007 at 5:32am Google Summer of Code Hacker, 222 Posts

> Instead of only dragging it, you mean? I just want to confirm that you were able to move your map point ....

Ah, I didn't realize you could do that. I had only tried double-clicking where I wanted the point.

Maybe instructions like "Drag and drop the marker to your location" should be added.




7 August 2007 at 4:07pm (Last edited: 7 August 2007 4:08pm), Community Member, 94 Posts

for dblclick to set the location, try something like
[code javascript/]
GEvent.addListener(map, "dblclick", function(overlay, point) {
document.getElementById("{$this->name}_latitude").value =;
document.getElementById("{$this->name}_longitude").value = point.lng();