17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2681 Views |
-
Google Mapping questions

13 July 2007 at 1:07pm Last edited: 13 July 2007 1:23pm
Ofir, can you explain why you need to force dev mode 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:
<?php
// Enter your free GoogleMaps API key from http://code.google.com/apis/maps/signup.html
$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
*/ContentNegotiator::disable();
Requirements::css("maps/css/Maps.css");
Requirements::javascript("http://maps.google.com/maps?file=api&v=2.x&key=".$GMaps_API_Key);
?> -
Re: Google Mapping questions

13 July 2007 at 3:26pm Last edited: 13 July 2007 3:27pm
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.
wget http://www.silverstripe.com/assets/downloads/modules/forum-0.11.tar.gz
wget http://www.silverstripe.com/assets/downloads/modules/maps-0.1.tar.gz
wget http://www.silverstripe.com/assets/rc/silverstripe-v2.0.2-rc3.tar.gztar xzf http://www.silverstripe.com/assets/rc/silverstripe-v2.0.2-rc3.tar.gz
cd silverstripe-v2.0
tar xzf ../maps-0.1.tar.gz
tar xzf ../forum-0.11.tar.gzAdd API to to maps/_config.php, get one from http://code.google.com/apis/maps/signup.html
chmod g+w .htaccess tutorial mysite assets
( visit the installer )
( go into cms and add a "ForumMemberMap" page)
-
Re: Google Mapping questions

13 July 2007 at 4:18pm Last edited: 13 July 2007 4:18pm
Ofir, you're requirement of:
Requirements::css("maps/css/Maps.css");
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("http://maps.google.com/maps?file=api&v=2.x&key=".$GMaps_API_Key);" then you get an XML-not-well formed error on the equals sign.
-
Re: Google Mapping questions

14 July 2007 at 4:42pm
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,
Elijah
-
Re: Google Mapping questions

15 July 2007 at 12:07am
Instead of only dragging it, you mean? I just want to confirm that you were able to move your map point ....
-
Re: Google Mapping questions

15 July 2007 at 5:32am
> 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.
Cheers,
Elijah
-
Re: Google Mapping questions

7 August 2007 at 4:07pm Last edited: 7 August 2007 4:08pm
for dblclick to set the location, try something like
[code javascript/]
GEvent.addListener(map, "dblclick", function(overlay, point) {
marker.setPoint(point);
document.getElementById("{$this->name}_latitude").value = point.lat();
document.getElementById("{$this->name}_longitude").value = point.lng();
});
| 2681 Views | ||
|
Page:
1
|
Go to Top |



