GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Get help with installation and running official modules for phpwcms here. Please do not post bug reports or feature requests here.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by jsw_nz »

Hi Breitsch and others...

I have a request to use the google map api on a current website. I normally develop off my localhost first....
I have a couple of beginner questions here. thanks in advance for any pointers.

API VERSION: From http://code.google.com/intl/nl/apis/map ... script/v2/
The Google Maps Javascript API Version 2 has been officially deprecated as of May 19, 2010. The V2 API will continue to work as per our deprecation policy, but we encourage you to migrate your code to version 3 of the Maps Javascript API.

Question 1:
I am assuming the module - due to its release name (NEW VERSION 3.0, 2009-02-22]) - supports the V3 API - is this true?

Question 2:
Can I use --//localhost/ for my API key .... Actually it is a subdirectory: --//localhost/mySubDirectory/

Question 3:
Does the geo_sitemap.xml file go inside the global root: http://localhost/ OR local root http://localhost/mySubDirectory/

thanks in advance....

cheers
jsw_nz :D
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by breitsch »

jsw_nz wrote: Question 1:
I am assuming the module - due to its release name (NEW VERSION 3.0, 2009-02-22]) - supports the V3 API - is this true?
No. the module does not (yet) support V3 API
jsw_nz wrote: Question 2:
Can I use --//localhost/ for my API key .... Actually it is a subdirectory: --//localhost/mySubDirectory/
should work, use http://localhost - you need to change the key when you go live
jsw_nz wrote:Question 3:
Does the geo_sitemap.xml file go inside the global root: http://localhost/ OR local root http://localhost/mySubDirectory/
local root, same directory as for the index.php
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by jsw_nz »

Hi Bretisch

I got it installed on a remote server - still having issues.

In the backend - contentpart dialogue/interface - after entering data and hitting update - get this error:
Warning: implode() [function.implode]: Invalid arguments passed in /var/www/vhosts/calderstewart.co.nz/httpdocs/include/inc_module/mod_googlemaps/inc/cnt.form.php on line 195
any ideas how to edit the cnt.form.php to eliminate error?

cheers
jsw_nz
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by jsw_nz »

hi Breitsch
enhanced algorithm for auto-zoom when several markers active (works now with small distances as well)
wanted to ask if there is any way to control this - ie turn it off in certain cases - guessing not.
i have a situation where i want a certain point to load centered in the map window - other adjacent points are not so important.

as a workaround - trying to write additional API code to repostion the center of the map. In this case the source code shows the map name as: map919.
However this is not working.

Code: Select all

map919.setCenter(new GLatLng(-41.5305253, 174.0122134), 18);
so my syntax is incorrect....

Any pointers...
namely 'move the map's center to the exact coordinates of the point (-41.5305253, 174.0122134)
so far not working - alert(map919) traces >>> null

is the additional API javascript injected in the wrong place >>ie - outside the scope of function initMap919() so therefore map919 is not seen/null?

Cheers
:D


UPDATE:
I modified the GoogleMapAPI.class.php file, repositioning the injection of additional_js to line 1458
(this is just before the closure of the function initMap919(), so map919 exists in this scope)

Code: Select all

$_output .= sprintf( '%s', $this->map_additional_js ) . "\n";
therfore the call to:

Code: Select all

map919.setCenter(new GLatLng(-41.5305253, 174.0122134), 18);
now works....
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by breitsch »

jsw_nz wrote: any ideas how to edit the cnt.form.php to eliminate error?
z
look here: http://forum.phpwcms.org/viewtopic.php? ... de#p128492
I guess it' sthe same issue
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by jsw_nz »

Cheers Breitsch,

I try to sort it out - will need a strong dose of google translate....heheh

BTW - the change I made to GoogleMapAPI.class.php file seems to work.
- perhaps you can include this edit in your module - which is absolutely GREAT!
BTW - I can now add polygons to the maps, since this edit.
many thanks -- :D
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by jsw_nz »

I have been asked by the client about the Google street view option - at present the module does offer the google earth option - but as far as I can see - implementing street view is not possible - wondering if it is an issue of v2 vs v3 of the Google Maps API - in principle - would there be anway to implement it with this existing module? Just asking...your thoughts Breitsch...

cheers,
:D

UPDATE
Was able to implement street view - spawned in a separate div - it also accepts mouse clicks to change the contents of streetview below.

Code: Select all

map1402.setCenter(new GLatLng(-45.87741996153507, 170.50705075263977), 17);
svOverlay = new GStreetviewOverlay();
map1402.addOverlay(svOverlay);
var panoOpts = {
  features: {
    streetView: true,
    userPhotos: false
  }
};
var myPano = new GStreetviewPanorama(document.getElementById("pano"),panoOpts);  
GEvent.addListener(map1402,"click", function(overlay,latlng) {
    myPano.setLocationAndPOV(latlng);
 });
var myLocation = new GLatLng(-45.877419, 170.507050);
myPOV = {yaw:310.0,pitch:4};
myPano.setLocationAndPOV(myLocation, myPOV);

The website is still under-construction - this page does reflect this implementation:
http://www.calderstewart.co.nz/index.ph ... #mainBlock

:D
novallis
Posts: 121
Joined: Tue 7. Dec 2004, 11:23
Location: Hassloch, Germany

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by novallis »

Add Overlay to the Google Map

Dear community,

I like to have a overlay of the german "Bundesländer"-borders over the google map showing my point set by the module and also the borders.

Is there a possibility to integrate the overlay (for example from kml-file) by additional api-code in the Google-Maps Content Part or somewhere else?

Can someone provide me the code?

Thanks for your help.

Regards,
Ralf (novallis)
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by breitsch »

in the additional API code field:

Code: Select all

var geoXml = new GGeoXml("http://www.yourdomian.tld/path/file.kml");
map357.addOverlay(geoXml);
change the map357 with the number indicated in your CP.
This adds the content of the kml with any points, overlays, etc. to the map.
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by breitsch »

jsw_nz wrote: is the additional API javascript injected in the wrong place >>ie - outside the scope of function initMap919() so therefore map919 is not seen/null?
this was a bug indeed
changed the file in Google Code r77 http://code.google.com/p/phpwcms-modules/
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
novallis
Posts: 121
Joined: Tue 7. Dec 2004, 11:23
Location: Hassloch, Germany

Re: GoogleMaps Module [VERSION 3.0, 2009-02-22] r77 (27.05.2011)

Post by novallis »

Here ist the changed file (see attachment below).

find at path:

Code: Select all

include  /  inc_module  /  mod_googlemaps  /  inc /
Now the integration of a "kml" overlay file works like a charm.

Thanks breitsch for the great Google Maps Module!

regards,
ralf (novallis)
Attachments
GoogleMapAPI.class.zip
Version r77 (27.05.2011)
found at google code
(14.4 KiB) Downloaded 370 times
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by update »

Hmmm... do you have an example at hand?
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
novallis
Posts: 121
Joined: Tue 7. Dec 2004, 11:23
Location: Hassloch, Germany

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by novallis »

Here is a simple example:
http://www.waldjugend.de/index.php?id=62,130,0,0,1,0

By the integration of kml-files it is now possible to enhance goolge maps (build by the google maps module / CP) with polygones and lines, etc.
The CP can only handly points.

regards,
ralf (novallis)
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by update »

Thanks - it's really nice!
Could you be so kind to give us an example where / how to get these cool kml-files?
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]

Post by pepe »

... better, how to write such files!
Post Reply