Page 8 of 10
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Mon 4. Apr 2011, 05:07
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
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Mon 4. Apr 2011, 12:03
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
local root, same directory as for the index.php
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Fri 8. Apr 2011, 00:35
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
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Sat 9. Apr 2011, 05:21
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
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....
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Sat 9. Apr 2011, 09:19
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
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Sat 9. Apr 2011, 10:04
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 --
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Tue 12. Apr 2011, 20:20
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,
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
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Thu 26. May 2011, 12:23
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)
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Fri 27. May 2011, 00:01
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.
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Fri 27. May 2011, 09:38
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/
Re: GoogleMaps Module [VERSION 3.0, 2009-02-22] r77 (27.05.2011)
Posted: Fri 27. May 2011, 11:13
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)
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Fri 27. May 2011, 17:51
by update
Hmmm... do you have an example at hand?
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Mon 30. May 2011, 09:18
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)
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Mon 30. May 2011, 10:28
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?
Re: GoogleMaps Module [NEW VERSION 3.0, 2009-02-22]
Posted: Mon 30. May 2011, 10:58
by pepe
... better, how to write such files!