Issue Summary
Continuing issue #818638-193: Update to use Google maps API V3
This topic was used for D7 release (first alpha release gmap 7.x-2.3-alpha3)
But starting from #1459606-72: [Needs tests] Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev we need backporting to D6 for 6.x-2.x branch
Any help welcomes. Thanks!
old summary for D7 release
Support for API ver3 is under the development, this feature is available from git repository.
$ git clone --branch 7.x-2.x http://git.drupal.org/project/gmap.git
And zip archive is also available from my github page.
(This is not necessarily the newest, because it is synchronized manually)https://github.com/haiiro-shimeji/gmap/zipball/7.x-2.x (directly link)
Unzip this archive, then you get a directory named "haiiro-shimeji-gmap-*".
This is the patched gmap module (full files).
Rename this directory to "gmap", and move this to the modues/ directory in drupal home.
To upgrade from 7.x-1.x version, you should just replace the code to 7.x-2.x.
And if you have some problem, you can revert safely with replacing 7.x-1.x code again.
Comments
#1
patch code
#2
This is an equivalent patch code for D7 to 818638 #120.
http://drupal.org/node/818638#comment-5593160
#3
Hello
Thanks for the patch. I'm trying to install it on D7 via SSH but i can't. I have tried to make it directly from withing the gmap folder but the patch does not work.
Could someone please send the right syntax to patch this file via ssh?
(we have read the dec posted here http://drupal.org/node/238692 and nor with patch -p0 or simply < work)
Some help with it?
Thanks
#4
Many thanks for your hard work! This is an update that the GMap module sorely needs!
One small suggestion that came to mind: in your patch, js/marker.js still has calls to a few v2 API methods:
openInfoWindow() [line 93]
openInfoWindowHtml() [line 111]
openInfoWindowTabsHtml() [line 122]
Since this a patch for GMap API v.3 compatibility, would it make sense to re-implement these via instantiations of google.maps.InfoWindow()?
#5
Google Map API Key is no longer available and there is no need for API request,
so I remove the input from GMap settings.
@aspitzer
These patch codes is for git repository. Use the patch as follows.
$ git clone --branch 7.x-1.x http://git.drupal.org/project/gmap.git
$ cd gmap/
$ git apply [patch file]
The details is described in this page.
http://drupal.org/node/33591/git-instructions
@mzanon.stoneward
Thanks for your suggestion, Those functions are replaced in this patch.
And these changes is applyed to the forked repository in github, too.
#6
Sorry I'm kind of a noob, how exactly do you use this patch? Where do I put it? I am assuming I need this patch to get the maps to display, because they are no longer displaying using the V3 Google Maps API.
#7
@haiiro.shimeji
Thanks for the info but I can`t manage to make Git work....
Would you mind uploading the patched files instead? It would be perfect!!
Thanks for your help!!
Andres
#8
Ok, you can use the zip ball instead of applying the patch.
Download the zip ball from the following url (directly link).
https://github.com/haiiro-shimeji/gmap/zipball/7.x-1.x-gv3
EDIT: zip archive is available from the link written in the top of this thread.
Unzip this archive, then you get a directory named "haiiro-shimeji-gmap-*".
This is the patched gmap module (full files).
Rename this directory to "gmap", and move this to the modues/ directory in drupal home.
#9
Thanks @haiiro.shimeji
I have uploaded the patched module. Now I son't se the api key warning anymore but still the maps are not showing up. Also I do not see the map for selecting the LAT LONG when I am creating new content.
What else should I check?
Thanks!
#10
@haiiro.shimeji
I had tghe module under sites/all/modules. I movet it to the drupal root/modules and it worked.
Thanks a lot!!
#11
Patch in #5 works fine
#12
I can approve #5, works for me!
#13
Hello, any updates for Drupal 6 and the Google API V3.
Our sites are getting old and tired, We depend on Drupal community to keep our Free Organisations sites alive.
Helping people all over the world.
It is just too costly to upgrade and redo a site when you only need a few modules to upgrade.
Please make this module compatible with Drupal 6 and Google API V3.
Thanks you.
#14
Hello, any updates for Drupal 6 and the Google API V3.
Our sites are getting old and tired, We depend on Drupal community to keep our Free Organisations sites alive.
Helping people all over the world.
It is just too costly to upgrade and redo a site when you only need a few modules to upgrade.
Please make this module compatible with Drupal 6 and Google API V3.
Thanks you.
#15
@taladega Please don't hijack the issue, this is for Drupal 7.
If you read the first post in this thread you would have seen the answer to your question, here it is http://drupal.org/node/818638#comment-5593160
#16
I had a problem on gmap_taxonomy.info but the patch works well. TY
patching file gmap_taxonomy.info
Hunk #1 FAILED at 4.
1 out of 1 hunk FAILED -- saving rejects to file gmap_taxonomy.info.rej
#17
The patch in #5 applies cleanly on a fresh clone of gmap 7.x-1.x.
On configuring gmap one bug has come up straightaway:
On line 20 of gmap_settings_ui.inc is
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) != FILE_DOWNLOADS_PUBLIC) {The variable table in D7 does not have 'file_downloads' and the constant 'FILE_DOWNLOADS_PUBLIC' does not exist either. The fix is simple, replace the above with
if (file_default_scheme() != 'public') {The following is not a bug but should be done for better control of the map.
In Googlemaps v3 the 'navigationControl' has been replaced by 'zoomControl' and 'panControl' although it still works.
#18
I've installed files from zip in #8, and I get the following error in the Gmap admin settings page:
Notice: Use of undefined constant FILE_DOWNLOADS_PUBLIC - assumed 'FILE_DOWNLOADS_PUBLIC' in gmap_admin_settings() (line 20 of /var/www/my-site.it/sites/all/modules/contrib/gmap/gmap_settings_ui.inc).Despite the error, all works fine
Thank you
UPDATE:
Applying the suggestion in #17 the error disappear
#19
@hutch, thanks for your indication.
I apply your code about the FILE_DOWNLOADS_PUBLIC problem to the zip ball, and make the new patch.
Zoom and pan controll is available by setting the macro 'control=Large'.
But v3 supports more controls (street view control etc.), it is good that this module also supports it.
#20
Downloaded the dev release and added the patch in #5 and the edit in #17. Also had the "hunk 1" failure, but I think that's probably not a problem.
Most of the functionality seems to work, except I don't get a gmap location picker. I'm using "Location CCK" as opposed to "node location". Is anyone getting the location picker with this version/patch? [EDIT: got that working-- a configuration issue.]
Also, any ideas on how to enable controls like street view and mobile location? I'm willing to put some work into getting this all going, but I'm not particularly familiar with the module.
#21
With the patch and mod, this works pretty good. But, one huge issue(to some maybe, to me definitely) is the "center on node argument" option in views->user_location_table->Format->GMap->Settings only seems to work with NID, and I'm using a view of user locations (UID). The resulting drop down is completely empty.
Going to take a look and see if I can find somewhere to differentiate between them, will post a patch if I get something going.
[edit] No, I'm not, I'm just going to re-do the site logic and use nodes to track these. If you want an authenticated user to be forced to create a node after registration, but before they can do anything else on a website, use the "checklist 7.x alpha" module [/edit]
#22
Hi adraskoy,
I have the same issue with the marker not showing, could you share what you did to get it working?
I'm really a noob on this.
Thx in advance
#23
haiiro.shimeji
Seems to mostly work, only thing is I cant seem to get the popup bubbles to work or taxonomy based markers.
#24
Thanks for your testing.
@Xomby
I wonder User location module is not supported for D7 according to http://drupal.org/project/location #Important section.
Actually nothing is displayed in /location/users despite of my setting..
@macrocosm
It seems popup bubble is working..
Have you setup the views setting? Choose edit "location table" in admin/structure/views, click Gmap setting in "Format",
and check "Display a tooltip when hovering over markers" in the setting dialog.
About taxonomy marker, I don't know how to use it.. Can't it set up the original marker??
#25
I applied patch in #19 but still giving me the same error http://maadiguide.com/
#26
Pardon my ignorance, but I got the new gmap moved over and now I see a map of the US, it's not zooming into street level. Did I miss something?
You can see at http://bluebonnetcountrygc.com/ready-to-play/location that it should be zoomed into the course location based upon the Location Module but it's not working right.
Thanks,
Danny
#27
I put the #8 patch in my root modules folder and it crashed my site. Does anyone have advice about what do to to get the site running again without starting over completely? I already deleted the patch and the gmap module and my site won't load. Any insite into why this happened will be so appreciated!
#28
@lgmanchego
This patch have no change for database.
Remove the patched module and put the old one, I think your site will be restored safely.
What does "crashed" mean? No page is displayed in your browser?
If that's the case, change display_errors parameter to "On" in the php.ini, please tell me the error messages.
#29
@dshaw66
I think there is no problem about zoom-in in my site..
It seems to be able to set up the max zoom level in Configuration -> GMap "Maximum initial zoom". Try to change this value to "17".
(but I wonder this restriction is not functioning..
#30
The map is using the Location module on the page to show the location of the course on the map. I can physically zoom into the map, but there is no marker and it's not going to the course location. Sorry that I didn't clarify.
EDIT: OK, that worked for it zooming in to the correct level, but the marker isn't showing. What am I missing for that to come back?
Danny
#31
@dshaw66
Sorry, I still have some questions..
There are some ways to display locations, so I cannot decide what kind of method is used.
Is the problem caused in Node Location page (/location/views)?
Are locations input by Location CCK or Node Location?
#32
I believe it's being input via the Node location, because on the content page I add the location to it in the Location area at the bottom. The map now zooms into the actual location correctly, it's just not showing a marker pin at the address location on the zoomed in map.
Thanks again!
#33
Selfirion, I don't recall the spot right now, but digging around there was somewhere where you have to say that you want a location picker. Maybe in the content type configuration for that field?
#34
@haiiro.shimeji
It appears your changes do not yet work with the location field, I get the same as the others, no markers appear.
#35
Sorry, there is no problem for me about markers appearance.
Someone has the same problem, please show me the gmap setting section in Drupal.settings.
Drupal.settings is in the javascript section in HTML code view.
Be careful not to include private information.
#36
Dear all,
I am using the form API to build new forms. I need to include a google map in the form and place some markers based on the position of the users.
I see that a lot of work has been done on google map api. However, I am not able to understand how to use it. If anyone can provide simple (but detailed) examples explaining how to use this api, it would be extremely helpful. I am at loss of how to use the immense module, without a help guide.
Thanks,
Ashvin
#37
Ashvin,
This thread is not about documentation, its about a rewrite of the module, which hasn't been updated in a long time.... haiiro.shimeji has been kind enough to take the gmaps 3x api integration on, but there are still other bugs to contend with, unrelated to what he's done. The standard documentation mostly still stands, just keep in mind 7.x branch is still pretty buggy.
Im changing this to critical because google is likely to drop support of the 2.x api sooner rather than later and then gmap wont work at all.
#38
@haiiro.shimeji, apply to be a maintainer, then perhaps something will be done.
gmap 7.x.2.x-dev for starters
#39
#19 works for me.
#40
@haiiro.shimeji:
I just forked a 7.x-2.x branch and merged your branch from hithub in.
#41
@all
haiiro.shimeji now has commit access to the repo.
#42
This is good news for Gmap.
@haiiro.shimeji, I will contribute a fully reworked marker system which I have deployed in Getlocations. It came from Gmap in the first place and makes full use of the v3 API, proper shadows, anchors, shapecoords and shapetype. A hook can be added that will allow other modules to add their own marker sets. If the Libraries module is present (or better still required) then markers can be stored in the libraries folder or in themes.
Other features will be better pathing to the cachefile, support for public/private and using Drupal's file_stream_wrapper method and use unmanaged to save the file, managed is for uploads and a cache does not need a record.
I will also fix that silly business of 10 letter markers and 26 number markers.
Let me know if you want this.
#43
@hutch
Thanks for your information!
I'm trying getlocation module..
#44
I think that all functionalities developed by Hutch in his getlocation module will be very useful also in GMap.
Thank you guys for working on this!
#45
Good stuff... but one stupid question still lingers in my mind... would it not make more sense to abstract the API calls out of the module, and into a separate module that just handles standardizing the API calls with acceptable fallbacks by default and user-selectable fallbacks where possible for deprecated functions?
May be a good rule of thumb for any 3rd party API... this way the API could advance, and the module would be forwards compatible with a newer version of the API, until it could catch up with any NEW functionality of that API... and potentially backwards compatable at the same time with an older version of the API (sometimes you just don't have a choice)?
#46
Patch in #5 works fine works for me!
#47
@haiiro.shimeji
I believe I'm having a similar issue as others. I am using a gmap view of locations of nodes (using a location field) and the markers are not showing up when I use your latest version (7.x.2.x-dev, http://drupal.org/node/1532336), whereas the markers do show up when I use 7.x.1.x-dev.
Thanks for all the work you've done!
-Matt
#48
@mmowers: try to apply my patch from here : #1218870: Marker managers give wrong path to marker icon when Drupal is not installed at root.
@haiiro.shimeji : are your still porting gmap to Google Maps API v3 ? Because I have some patch I would like to submit to you : #1218870: Marker managers give wrong path to marker icon when Drupal is not installed at root and #1565792: MarkerClusterer is not working and #774078: ExtInfoWindow for GMap - Styling the info window for Google Maps. The last patch is not from me but it would be awesome to have it to. However it needs some works to work with your Gmap version.
#49
@hadim: Thanks much for the patch, but it did not do the trick for my problem. Bear in mind that I am not doing any marker clustering, and my gmap view works fine on 7.x.-1.x-dev. Also, for some reason I couldn't apply your patch directly. I believe the issue may be these lines in your patch:
@@ -553,11 +553,15 @@ function gmap_menu() {* Regenerate the markerdata file.
*/
function gmap_regenerate_markers() {
In any case, I ended up just applying your changes manually, and I still was not able to see markers on my map.
@haiiro.shimeji: I just noticed that, when I load my gmap view page, javascript throws an error: "Uncaught ReferenceError: GMarkerManager is not defined" on line 20 of gmarkermanager_marker.js:
obj.mm = new GMarkerManager(obj.map, Drupal.settings.gmap_markermanager);(This occurs with or without hadim's patch). Does anyone know if GMarkerManager is used in google maps api v3?
Thanks again,
Matt
#50
@mmowers: sorry but I didn't got this bug and I have no idea where it may come... GMarkerManager is working fine for me.
Good luck !
#51
@mmowers
Thank you very much! I got the same error.
I'm trying to fix this, but it seems so difficult..
I make the issue #1573062.
@hadim
Thanks for your notification. I'll check the patches and apply.
#52
@mmowers
I make a patch code in http://drupal.org/node/1573062,
This is trick for javascript error, but I cannot make sure markermanager is working correctly..
please try it.
#53
@haiiro.shimeji: Thanks!! Your solution worked for me. I'll let you know if I run into any more issues.
Thanks again!
-Matt
#54
I installed d7.2 version from here http://drupal.org/node/33591/release?api_version%5B%5D=103
this is all on new d7 installationa and i can't make maps appear, there is also a "Google Maps API Key" field in this version which you said will be removed?! Needing some help with this.
Installed location and gmap module, done this before with d6 many times and I know how to do it, but now I can't get any map to display?
#55
I recommend switching to http://drupal.org/project/getlocations it contains most of the gmaps and location module in it and does it better.
#56
released alpha release for 7.x-2.x
please. help with test and bug fix
#57
Automatically closed -- issue fixed for 2 weeks with no activity.
#58
It sure seems like the API key is not necessary anymore, but it's still a field on
/admin/config/services/gmapAlso -- it looks like 2.x-dev was patched to remove the
variable_del("googlemap_api_key")but the field on the settings page still creates that variable...#59
Also line 134 of
gmap_gmap():<?phpdrupal_add_js('http://maps.google.com/maps?file=api&v=2.115&key='.variable_get('googlemap_api_key').'&;hl=en');
?>
i see key and hard-coded ref to v2?
#60
Also -- I'm seeing total removal of the Key in this patch, but according to Google:
Shouldn't we still be supporting a key?
#61
also -- looks like baseURL of google maps is wrong:
<?php$ret[url(gmap_views_protocol() . '://maps.google.com/maps/'.$file, array('query' => $query))] = array(
?>
should be "maps.googleapis.com/maps/"
(https://developers.google.com/maps/documentation/javascript/tutorial#Loa...)
#62
Attached is a patch that address my last few comments.
Summary:
variable_del()in gmap.install#63
There is still some code from v2 API
ReferenceError: GLatLng is not defined
[Stopper sur une erreur]
pa.push(new GLatLng(n[0], n[1]));
in http://test.loc/sites/all/modules/contrib/gmap/js/gmap_shapes.js Line 40
hope it helps
#64
can someone review this patch for creating initial Goodle v3 dev version for testing on alpha(beta) versions?
#62 looks good for me, but I have no possibility to test it on production now
#65
All I need - patch against latest 7.x-2.x-dev for review
#66
I applied this patch to the latest 7.x-2.x and it seems to work fine.
I wonder the old variable 'googlemap_api_key' also should be removed when the module is uninstalled,
because this might be registered before the module is upgraded from 7.x-1.x.
If anyone have no problem, I'll commit this patch to 7.x-2.x branch.
#67
#66 looks good
Please - commit it into 7.x-2.x for testing
I think that we can generate beta release later here for a lot of testers activity
#68
Maybe that should go into an update function rather than the install?
#69
re-rolled (still not deleting old 'googlemap_api_key' though, let me know if i should add..
#70
#69 looks good for me
commited pushed to 7.x-2.x-dev
Please, open follow up issue for right "deleting old 'googlemap_api_key' "
Thanks to all!!!
#71
tagged alpha-3 release http://drupal.org/node/1904578
#72
this needs backport to D6 as requested from #818638-193: Update to use Google maps API V3
6.x-2.x branch created for this
#73
@podarok, good to see the Gmap module being kicked out of the long grass.
I am the maintainer of Getlocations and if you want code to get markers working for Google v3 I would suggest you "borrow" it from Getlocations, I "borrowed" it from Gmap in the first place ;-)
In particular,
getlocations/js/icons.js
getlocations/getlocations.markerinfo.inc
and functions
getlocations_get_marker_titles()
getlocations_get_icondata()
getlocations_regenerate_markers()
getlocations_get_markerfile()
getlocations_getlocations_markerdir()
(I think that's all)
There are links on the project page for markers with .ini files, shadows etc.
put marker folders in "libraries/gmap/markers"
There are some minor differences between D6 and D7, mainly to do with how files are accessed.
With any luck you should be able to get most of it working by renaming and search and replace "getlocations" with "gmap"
It might work :-)
#74
Shouldn't we get hutch's marker and icon code in here before we start backporting?
#75
#73 can You provide a patch against 7.x-2.x-dev?
#76
At the moment I'm very pushed for time, I don't have a Gmap testrig set up and haven't looked at the Gmap code in at least a year, that is why I did not offer a patch in #73.
Someone who knows Gmap in its current dev state will be much better placed to get this going.
#77
Thank you for this excellent module and the efforts you ' ve put into!
I'm testing the 7.x-2.x-dev along with the Location Module (7.x-3.0-alpha1) and my custom markers.
Everything seems to be working perfectly at the moment, nodes display locations correctly and showing the right custom marker.
The only problem I face is that I have a VIEW where:
It shows the right locations but I need to use the marker that I' ve chosen at each taxonomy term for the specific vocabulary.
"Marker / fallback marker to use " is set to Default, but instead of my custom marker, it returns a red one from the defaults of the module.
Am I missing something?
That's the way my VIEW works right now for me with GMAP 7.x-1.0-beta1 and LOCATION 7.x-3.0-alpha1.
Sorry for my long writing and actually I am not sure if this is the right place to report such kind of problem , excuse me again if I'm wrong!
#78
Hi,
I think this needs backport to D6 now as @Hutch is not bringing the marker and icon code in within reasonable time and it is requested from #818638-193: Update to use Google maps API V3, right?
Greetings, Martijn
#79
Here is a patch for 6.x-2.x-dev to get things moving for D6. This is a backport of the patches in #19 and #69.
#80
Hi, can someone make a D6 winzip maybe which I can test. I am not able to execute patches right now. Thanks in advance.
greetings, Martijn
#81
#79 commited pushed to 6.x-2.x-dev
thanks!!!
will be tagged in next 6.x beta release soon
#82
#80 You can try it here http://drupal.org/node/1926766
#83
#79: Backport_from_D7_to_use_Google_maps_API_V3_for_D6-1459606-79.patch queued for re-testing.
#84
The last submitted patch, Backport_from_D7_to_use_Google_maps_API_V3_for_D6-1459606-79.patch, failed testing.
#85
#79 commited! )))
It can`t be tested anymore - it is already in repo!
#86
When you use a view with GMap display style, marker popups don't display. It works well with 6.x-1.1 version.
#87
Sorry... It works when the option "Marker action" is set to "Open popup". In 6.x-1.1 version the popup displays even if this option is set to "Do nothing".
#88
This one needs tests
use /tests/gmap.test for that
#89
Any news on the test phase of the backport ? Can't test right now.
#90
6.x-2.x-dev works for me after removing the check for a Google Maps key:
<?phpfunction theme_gmap($element) {
// Usability: Prevent js errors on first visit to settings page, etc.
// Of course it will still error if the *wrong* key is on file.
if (gmap_get_key() == '') {
//return t('Unable to render map: Google Maps API key is missing.');
}
?>
#91
Confirmed, the same as #90 for me.
#92
Here is a patch
#93
Any updates on this? Does anyone know when we might have a fully tested version?
Thanks,
James
#94
james.morris: I just checked out a git copy and there is lots left to be done. I'm new to gmaps.module, and only about 10 minutes into investigation, but I would say that the map generation itself is good, and markers seem ready, but much of the related functionality is barely converted. I see all sorts of v2 syntax all over the place (GLatLng, GMarker) and the PolyLine/PolyGon stuff looks v2. I also see lot's of commented code all over the place (whole handler functions.)
[edit:] Wanted to add that the geocoding looks like it works with v3.
This month we'll likely have lot's of help as the May 19 deadline is looming. We (wunderkraut) have a couple of clients that need some of the advanced functionality, so I'll add what I can to this effort.
#95
@Jaxxed
Yeh. I've tried it out too. I find the same GeoLocation doesn't work just returns the default 0,0 long lat. Problem is that Google Maps are turning off the V2 of the API in May apparently.
#96
I have finished going though the code and have the remaining items patched for v3 (still testing everything)
I've made the following changes:
1. updated various left over GMarker Calls,
2. made some jquery optimizations (pooled sequential .addClasses)
3. made some google.maps. optimizations (switched some addEventListener to addEventListenerOnce)
4. switched a number of the GPolygon circle implementations to google.maps.Circle;
5. upgraded GPolygon (only found one) to google.maps.Polygon
6. used google.maps.MVCArray in a few places where [{google.maps.point}] was previously used.
As I am new to this thread, I've messaged podarok, who seems to be the most recent maintainer for the code, to see what the best way to push these changes is. I don't know that it makes sense to post a patch with such a large change.
If there is demand, I will consider:
1. posting that patch
2. assigning myself to the ticket
3. helping others with the patch/responding to individual requests.
I am now going into testing on the work that I did, as I upgrade a client site. I should be able to test most of it today.
#97
#95 james.morris: I'll take a look at the geolocation. It looks like it should work, but I'll try to test it out and see why it isn't.
[edit:] j.m: can you write a test case for it?
[edit:] @james.morris : is the php geolocation failing, or the js geolocation?
I am not worried about the May 19 deadline yet. There is still lot's of time to fix this, and I can fit some hours to a billable client on the fix.
#98
#92 hutch: the only problem with your fix is that google maps v3 can work without a key now.
https://developers.google.com/maps/articles/v2tov3#newkey
#99
Does anybody know what this is: GMarkerManager() ?
#100
@Jaxxed:
I am afraid that I don't know which part of the Geolocation is failing. We performing client monthly (in this case April's) updates on critical and out of date modules. The client only really pays for the updating, they have to request and pay for any further investigation.
In terms of a test case.
We have the locations field on an events content type and have tried the following with both the V2 and V3 API key.
Add your home address with postcode.
Satisfy any other mandatory fields.
Save the node
View the node
Map should appear (on V3) but centred on the 0,0 long lat.
Sorry if that's not detailed enough. Let me know if you need more.
Cheers
#101
@jaxxed, the patch in #92 removes the check as it is no longer required.
#102
bot
#103
Is there a recommended upgrade procedure for jumping between 6.x-1.x and 6.x-2.x. I see that you loose your api key.
#104
Maybe you lose your key because v2 keys are not compatible with v3
#105
Just a quick note about working with the 6.x-2.x:
I've had no problems with the gmaps libraries, using Drupal.gmaps directly. I've been using this:
1. gmaps creation
2. gmaps markers, and custom .binds around marker events.
I did get some errors that I am hunting out, but I think that they are related to custom code.
There is only 1 vague issue right now that my related to delays in display, that sometimes gmaps v3 doesn't handle well. I've solved some problems by trying to pass centering and zooming info on map creation, instead of after ... but I can't confirm that it's worthwhile pushing that to the module repo.
I would appreciate it if anybody could provide test cases for the following:
1. address geo-location that is failing
2. use of shapes that worked in gmaps v2
#106
Hi !
I'm testing the 2.0-beta1 with patch from #92.
I've created a new gmap API key V3 and use shapes directly in a template page on a production website : AAAR : that's the color around districts of the region Centre in France.
So it works well on the 1.x plugin but not in the 2.0-beta1.
Here is the way I echo it in my template :
https://gist.github.com/nderambure/5405526
And here is the console error I got :
Uncaught ReferenceError: GLatLng is not definedin the file gmap_shapes.js at line 35.
Note that my markers work perfectly (with a little CSS adjustements), if I remove the 'shapes' parameter.
Hope it helps !
#107
Happy to help testing here, too. Basic marker functionality appears good and maps set up for v2 on live site work very well on v3 on dev site so far. Again all worked after I removed the v2 api check patched above. I will test the shapes and report back.
#108
Hi,
We've managed to get our GMaps geo-location working again by doing the following.
1) Update the GMaps module to 2.0-beta1
2) (Crucial bit) update the location module to version 3.3-beta3
3) Once you've done this update the GMaps with your V3 Google Maps API key.
4) Ensure you have JS Optimise enabled under Performance settings.
4) Clear the caches, then do it again for luck (last cache clear optional).
5) Try create a test node with new address for Geo encoding.
6) Check the node you should now have a geo-encoded map marker.
This is not fully tested. It seems to work but because it relies on beta version of the Gmaps and Location module make you and you clients test thoroughly.
I hope that help.
James
#109
Hi,
I thought google didn't have an API-key anymore after V2?
I refer to this part:
3) Once you've done this update the GMaps with your V3 Google Maps API key.greetings, Martijn
#110
API key is optional in V3 -- if you enter it you can review metrics at https://code.google.com/apis/console
#111
According to Google @ https://developers.google.com/maps/documentation/javascript/v2/reference
...
Note: The Google Maps JavaScript API Version 2 has been officially deprecated as of May 19, 2010. The V2 API will continue to work until May 19, 2013. We encourage you to migrate your code to version 3 of the Maps JavaScript API.
...
It says the V2 API will continue to work until May 19, 2013. Does it mean GMap 6.x-1.x will stop working on that day?
Thanks!
#112
#111 yes!
#113
@podarok
Thanks for your confirmation.
#114
Hrm, looks like I have some sites that need this upgrade as well, currently on 1.x
Will probably be doing some test upgrades around May 6th, will add my comments on experience with patches after that
#115
Patch at #92 works.
Why is this issue marked as needs work then?
#116
upgraded on JS file, to upgade v2->v3 google maps shapes calls. Changed the 'circle' shape to no longer be an rpolygon.
I've tested the circle, lines, polygons (encoded and from points, and from points coming from google.maps.directionsService)
I wasn't sure if this was ready to submit, but I thought that I would post it and see what comments it gets. There aren't really any tests for this kind of a patch.
J
#117
stupid me, changed the title back
#118
changing to needs review to get the patch I wrote tested
#119
Thx jaxxed, I'll test this new patch this week-end and report back here.
#120
Highlight JS needed upgrade to v3. I did it and then realized that you had some new code for D7 that was v3 compliant.
I didn't like the new D7 highlight approach, and submitted a patch that was tested in the D6, but is D7 compliant (only JS changes). I don't like how highlight.js has only global functions for marker highlights, and how marker.js has highlight events embedded.
Please consider this for inclusion.
http://drupal.org/node/1982292
#121
#116 should be in another follow-up issue
#122
Some outstanding tasks that I see:
Marker Clustering / Marker Management:
These guys all re-declare the factory.marker(loc,opts) and return a "new GMarker". I can copy over the gmap_marker.js code them, but I am not sure that they are even needed. Integrated code should likely be using an obj.change('addMarker')?
Marker Loader GeoRss
markerloader_georss.sj:21:
var xml = GXml.parse(data);
markerloader_georss.sj:81:
// This sucks, but jQuery and IE don't get along here.
GDownloadUrl(feed.url, getfn(feed.markername));
Perhaps we can return to using $.ajax() now as things probably work much better. Then we won't need a GXml either ($.ajax returns JSON DOM.)
Would module op care to assign particular parts of the backport/migration as higher priority?
#123
#121 => http://drupal.org/node/1982320
edit: This is about upgrading the shapes library. This patch was moved to it's own thread, which you can find at the above link.
This move was at the request of the module op, and is required as a single patch per thread is then applied to the source, marking the task closed.
#124
Is there anybody in a place to be able to test the georss markerloader code in IE?
#125
does anyone have a testing environment that uses a lot of shapes, and that can test a more recent shapes patch?
(we're getting close to the deadline, and the shapes library seems important to me. If we can wrap it up I can move on to the lower priority use cases, and remove the last of the gmaps v2 reliant code.)
#126
I have a little test environnement that does not use intensive shapes as said in http://drupal.org/node/1459606#comment-7312414
But If you have a more recent patch for 6.X, I'll test this afternoon !
#127
jaxxed, there is a typo in line 66 of the patch joined in #116, that must be 'nofillstyle' instead of 'fillstyle'.
Anyway, my shapes don't work with this patch. There is constructor problem, I'm investigating.
#128
Ok I've tested my polygons with the 2.0-beta1 applying both patches from #92 and #116, and it first don't work.
I've made a patch for polygons support, and now it works, but some work has to be done about others shapes regarding styles.
#129
The last submitted patch, gmaps-googlemapsv3upgrade.patch, failed testing.
#130
oops, sorry for the non working patch.
New patch below.
#131
The new patch for taking care of shapes (at least polygons).
#132
#133
#13 commited pushed to 6.x-2.x
Thanks!!!
tagged new beta http://drupal.org/node/1988320
#134
uh ?
That's not fixed. As I was saying in #131, there is some more to do, at least in gmap_shapes.js.
Why put this fixed ?
#135
re #134 good drupal.org practice - creating follow-ups for feature fixes without spamming huge issue and 78+ followers
So better close this one with fixed status and create follow-up task issue with backlink here
#136
Ok @podarok, thx for explaining :)
#137
it looks like google will extend the v2 library usage via a wrapper. This means that it is likely that most simple use cases will still work. Nobody has any way of testing to see what will and won't work, but this reduces the priority of the v3 update and the d6 backport
#138
Hmmm and there's me having pushed 6.x-2.x-dev to a live site due to thinking it'd stop working by today....
Supported directly until 19th November 2013, and with the wrapper afterwards (for an unknown amount of time).
#139
I did upgrade from 6.x-1.1 to 6.x-2.0-beta2.
Using GMap, and its submodule GMap Location for displaying Node Map (map/node).
The Node map is displaying but there are some problems yet..
1) Marker action setting's option "Open info window" doesn't work. Both GMap (/admin/settings/gmap) and GMap Location (/admin/settings/gmap_location) have the Marker action setting.
Firefox java console is displaying these errors:
"TypeError: marker.marker.openInfoWindowHtml is not a function
marker.marker.openInfoWindowHtml(data);"
"TypeError: currentMarker.marker.getPoint is not a function
var markerPoint = currentMarker.marker.getPoint();"
2) The error
"TypeError: currentMarker.marker.getPoint is not a function
var markerPoint = currentMarker.marker.getPoint();"
also seems to target the Ubercart Ajax Cart module.
Edit: Found out that the (gmap/js/) marker.js file is causing those errors. That file needs to be replaced with new one, otherwise the marker action setting's option "Open info window" wont work.
#140
RE: #139
I looked into the code, and the 6.x code has most of the infoWindow calls transitioned, but not all. The 7.x-2.x code has all of them transitioned. this looks to be a backporting issue.
if your /js/marker.js:116 looks like this:
$.get(uri, {}, function (data) {obj.rmtcache[marker.rmt] = data;
marker.marker.openInfoWindowHtml(data);
});
The D7 code looks like this: (/js/marker.js:
jQuery.get(uri, {}, function (data) {infowindow.setContent(data);
infowindow.open(obj.map, marker.marker);
});
As the D6 code still has the RMTCache, it should look like this:
jQuery.get(uri, {}, function (data) {obj.rmtcache[marker.rmt] = data; /* this line is not in the D7 */
infowindow.setContent(data);
infowindow.open(obj.map, marker.marker);
});
I've attached a patch that does that. This will likely need to be moved to a different thread.
Note also:
- some bad whitespace was removed
- there was another RMT Cache mistake, where the cache is checked and then the wrong variable is written to the info window
#141
#131: gmaps-upgradeGmapV3-1459606.patch queued for re-testing.
#142
The last submitted patch, gmaps-markerrmterrors-1459606-140.patch, failed testing.