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: [CLOSED] 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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

haiiro.shimeji’s picture

haiiro.shimeji’s picture

Priority: Critical » Normal
Status: Active » Needs review
FileSize
49.24 KB

This is an equivalent patch code for D7 to 818638 #120.
http://drupal.org/node/818638#comment-5593160

aspitzer’s picture

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

mzanon.stoneward’s picture

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()?

haiiro.shimeji’s picture

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.

htalwala’s picture

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.

aspitzer’s picture

@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

haiiro.shimeji’s picture

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.

haiiro.shimeji’s picture

Issue summary: View changes

This feature was applied to 7.x-2.x, so change the description.

aspitzer’s picture

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!

aspitzer’s picture

@haiiro.shimeji

I had tghe module under sites/all/modules. I movet it to the drupal root/modules and it worked.

Thanks a lot!!

caktux’s picture

Patch in #5 works fine

webcultist’s picture

I can approve #5, works for me!

taladega’s picture

Title: Update to use Google maps API V3 for D7 » Update - UpGRADE Google maps API V3 for D6 Please!
Version: 7.x-1.x-dev » 6.x-1.x-dev
Component: Code » Miscellaneous
Priority: Normal » Major

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.

taladega’s picture

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.

izmeez’s picture

Title: Update - UpGRADE Google maps API V3 for D6 Please! » Update to use Google maps API V3 for D7
Version: 6.x-1.x-dev » 7.x-1.x-dev
Component: Miscellaneous » Code
Priority: Major » Normal

@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

Patrizio’s picture

Status: Needs review » Reviewed & tested by the community

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

hutch’s picture

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.

MXT’s picture

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

haiiro.shimeji’s picture

@hutch, thanks for your indication.
I apply your code about the FILE_DOWNLOADS_PUBLIC problem to the zip ball, and make the new patch.

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.

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.

adraskoy’s picture

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.

Xomby’s picture

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]

Selfirian’s picture

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

Macronomicus’s picture

haiiro.shimeji
Seems to mostly work, only thing is I cant seem to get the popup bubbles to work or taxonomy based markers.

haiiro.shimeji’s picture

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??

mdotcomegypt’s picture

I applied patch in #19 but still giving me the same error http://maadiguide.com/

dshaw66’s picture

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

lgmanchego’s picture

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!

haiiro.shimeji’s picture

@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.

haiiro.shimeji’s picture

@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..

dshaw66’s picture

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

haiiro.shimeji’s picture

@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?

dshaw66’s picture

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!

adraskoy’s picture

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?

Macronomicus’s picture

@haiiro.shimeji

It appears your changes do not yet work with the location field, I get the same as the others, no markers appear.

haiiro.shimeji’s picture

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.

Ashvin Lakshmikantha’s picture

Component: Code » Documentation

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

Macronomicus’s picture

Component: Documentation » Code
Priority: Normal » Critical
Status: Reviewed & tested by the community » Needs work

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.

hutch’s picture

@haiiro.shimeji, apply to be a maintainer, then perhaps something will be done.
gmap 7.x.2.x-dev for starters

neochief’s picture

Status: Needs work » Reviewed & tested by the community

#19 works for me.

bdragon’s picture

Status: Reviewed & tested by the community » Active

@haiiro.shimeji:

I just forked a 7.x-2.x branch and merged your branch from hithub in.

bdragon’s picture

@all

haiiro.shimeji now has commit access to the repo.

hutch’s picture

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.

haiiro.shimeji’s picture

Priority: Normal » Critical
Status: Needs review » Active

@hutch
Thanks for your information!
I'm trying getlocation module..

haiiro.shimeji’s picture

Issue summary: View changes

add description for zip-ball.

MXT’s picture

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!

Xomby’s picture

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)?

sachin00700’s picture

Patch in #5 works fine works for me!

mmowers’s picture

@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

hadim’s picture

@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.

mmowers’s picture

@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

hadim’s picture

@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 !

haiiro.shimeji’s picture

@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.

haiiro.shimeji’s picture

@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.

mmowers’s picture

@haiiro.shimeji: Thanks!! Your solution worked for me. I'll let you know if I run into any more issues.
Thanks again!
-Matt

Marko B’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Category: feature » bug

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?

Marko B’s picture

I recommend switching to http://drupal.org/project/getlocations it contains most of the gmaps and location module in it and does it better.

podarok’s picture

Version: 7.x-2.x-dev » 7.x-2.3-alpha2
Status: Active » Fixed

released alpha release for 7.x-2.x
please. help with test and bug fix

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tmsimont’s picture

Version: 7.x-2.3-alpha2 » 7.x-2.x-dev
Status: Closed (fixed) » Active

It sure seems like the API key is not necessary anymore, but it's still a field on /admin/config/services/gmap

Also -- 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...

tmsimont’s picture

Also line 134 of gmap_gmap():

drupal_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?

tmsimont’s picture

Also -- I'm seeing total removal of the Key in this patch, but according to Google:

The Google Maps JavaScript API v3 does not require an API key to function correctly. However, we strongly encourage you to load the Maps API using an APIs Console key which allows you to monitor your application's Maps API usage. Learn how to use an APIs Console key.

Shouldn't we still be supporting a key?

tmsimont’s picture

also -- looks like baseURL of google maps is wrong:

 $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...)

tmsimont’s picture

Status: Active » Needs review
FileSize
4.36 KB

Attached is a patch that address my last few comments.

Summary:

  1. Restored variable_del() in gmap.install
  2. Renamed variable "googlemap_api_key" to "gmap_api_key" to be consistent with other vars
  3. Removed hard-coded v2 reference
  4. Added key back to query
  5. Adjusted help text on key field on settings page
  6. Fixed Base URL for google maps API service
Sylvain_G’s picture

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

podarok’s picture

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

podarok’s picture

Issue summary: View changes

add the description for upgrading from 7.x-1.x

podarok’s picture

Status: Needs review » Needs work

All I need - patch against latest 7.x-2.x-dev for review

haiiro.shimeji’s picture

Status: Needs work » Reviewed & tested by the community

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.

podarok’s picture

#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

tmsimont’s picture

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.

Maybe that should go into an update function rather than the install?

tmsimont’s picture

re-rolled (still not deleting old 'googlemap_api_key' though, let me know if i should add..

podarok’s picture

Status: Reviewed & tested by the community » Fixed

#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!!!

podarok’s picture

tagged alpha-3 release http://drupal.org/node/1904578

podarok’s picture

Title: Update to use Google maps API V3 for D7 » Backport from D7 to use Google maps API V3 for D6
Version: 7.x-2.x-dev » 6.x-2.x-dev
Category: bug » task
Priority: Critical » Major
Status: Fixed » Needs work
Issue tags: +needs backport to 6.x

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

podarok’s picture

Issue summary: View changes

Updated issue summary.

hutch’s picture

@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 :-)

tmsimont’s picture

Title: Backport from D7 to use Google maps API V3 for D6 » Finish D7 changes to Google maps API V3 then backport for D6
Version: 6.x-2.x-dev » 7.x-2.x-dev

Shouldn't we get hutch's marker and icon code in here before we start backporting?

podarok’s picture

#73 can You provide a patch against 7.x-2.x-dev?

hutch’s picture

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.

tazbambu’s picture

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:

  • I'm showing content
  • Format is GMAP
  • Showing fields
  • Relationship -->Content: Taxonomy terms on node
  • MARKER HANDLING --> By Term (for node views).

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!

Summit’s picture

Title: Finish D7 changes to Google maps API V3 then backport for D6 » Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev
Status: Needs work » Active

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

rjay’s picture

Status: Active » Needs review
FileSize
45.4 KB

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.

Summit’s picture

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

podarok’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Needs review » Fixed

#79 commited pushed to 6.x-2.x-dev

thanks!!!

will be tagged in next 6.x beta release soon

podarok’s picture

rjay’s picture

Status: Fixed » Needs review
Issue tags: -needs backport to 6.x

Status: Needs review » Needs work
Issue tags: +needs backport to 6.x
podarok’s picture

Status: Needs work » Fixed

#79 commited! )))
It can`t be tested anymore - it is already in repo!

ocanzillon’s picture

Status: Fixed » Needs work

When you use a view with GMap display style, marker popups don't display. It works well with 6.x-1.1 version.

ocanzillon’s picture

Status: Needs work » Fixed

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".

podarok’s picture

Title: Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev » [Needs tests] Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev
Status: Fixed » Needs work
Issue tags: -needs backport to 6.x +Needs tests

This one needs tests

use /tests/gmap.test for that

dway’s picture

Any news on the test phase of the backport ? Can't test right now.

fizk’s picture

6.x-2.x-dev works for me after removing the check for a Google Maps key:

function 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.');
  }
iancawthorne’s picture

Confirmed, the same as #90 for me.

hutch’s picture

Here is a patch

james.morris’s picture

Any updates on this? Does anyone know when we might have a fully tested version?

Thanks,

James

jaxxed’s picture

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.

james.morris’s picture

@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.

jaxxed’s picture

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.

jaxxed’s picture

#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.

jaxxed’s picture

#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

jaxxed’s picture

Does anybody know what this is: GMarkerManager() ?

james.morris’s picture

@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

hutch’s picture

@jaxxed, the patch in #92 removes the check as it is no longer required.

podarok’s picture

Status: Needs work » Needs review

bot

acrazyanimal’s picture

Status: Needs review » Needs work

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.

jaxxed’s picture

Maybe you lose your key because v2 keys are not compatible with v3

jaxxed’s picture

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

dway’s picture

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 defined
in 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 !

musojon74’s picture

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.

james.morris’s picture

Issue tags: +location, +gmaps

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

Summit’s picture

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

tmsimont’s picture

API key is optional in V3 -- if you enter it you can review metrics at https://code.google.com/apis/console

cosmos11’s picture

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!

podarok’s picture

#111 yes!

cosmos11’s picture

@podarok

Thanks for your confirmation.

Sansui’s picture

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

anrikun’s picture

Patch at #92 works.
Why is this issue marked as needs work then?

jaxxed’s picture

Title: [Needs tests] Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev » Here is a patch to upgrade the gmap_shapes stuff
FileSize
9.28 KB

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

jaxxed’s picture

Title: Here is a patch to upgrade the gmap_shapes stuff » [Needs tests] Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev

stupid me, changed the title back

jaxxed’s picture

Status: Needs work » Needs review

changing to needs review to get the patch I wrote tested

dway’s picture

Thx jaxxed, I'll test this new patch this week-end and report back here.

jaxxed’s picture

Issue tags: -Needs tests

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

podarok’s picture

Priority: Major » Normal
Status: Needs review » Fixed

#116 should be in another follow-up issue

jaxxed’s picture

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?

jaxxed’s picture

Priority: Normal » Major
Status: Fixed » Needs review

#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.

jaxxed’s picture

Is there anybody in a place to be able to test the georss markerloader code in IE?

jaxxed’s picture

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.)

dway’s picture

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 !

dway’s picture

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.

dway’s picture

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.

Status: Needs review » Needs work

The last submitted patch, gmaps-googlemapsv3upgrade.patch, failed testing.

dway’s picture

oops, sorry for the non working patch.
New patch below.

dway’s picture

The new patch for taking care of shapes (at least polygons).

dway’s picture

Status: Needs work » Needs review
podarok’s picture

Status: Needs review » Fixed

#13 commited pushed to 6.x-2.x
Thanks!!!

tagged new beta http://drupal.org/node/1988320

dway’s picture

Status: Fixed » Needs review

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 ?

podarok’s picture

Status: Needs review » Postponed (maintainer needs more info)

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

dway’s picture

Ok @podarok, thx for explaining :)

jaxxed’s picture

Priority: Major » Normal

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

musojon74’s picture

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).

miccelito’s picture

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.

jaxxed’s picture

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

JKey’s picture

Status: Postponed (maintainer needs more info) » Needs review
Issue tags: -location, -gmaps

#131: gmaps-upgradeGmapV3-1459606.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +location, +gmaps

The last submitted patch, gmaps-markerrmterrors-1459606-140.patch, failed testing.

dway’s picture

Hey, it seems that the 6.x version is still not working, and the last patch did not pass tests...
Is this module still alive ?

podarok’s picture

latest patch needs re-roll

miccelito’s picture

@140: Confirm that the patch solves the mentioned problem

willeaton’s picture

Hi, I needed to port the module to Gmaps V3 a while ago (Google said it would stop working shortly) so I updated it using some patches posted, I now see that the module has progressed well and I can revert back to the official module code. The only problem I have (before and after) is that when I set coordinates and I zoom out from the default zoom level, my custom marker seems to move slowly left. In my case I start off smack bang in the middle of the UK, then slowly move into Ireland, and eventually into the Atlantic Ocean as I zoom out. Is anyone else experiencing this or knows what is causing it?

willeaton’s picture

Forget my last comment - its simply that the anchorX value needed changing.

Jim Kirkpatrick’s picture

Hi all, I wondered if we could get clarification on what is left to do on this? Is there another issue that needs to be created/linked to so the D6 v2 work can finish up? I'm a little lost...

I've also got my own hacked version of 1.x that I'd like to put to rest!

Any updates or a summary would be warmly welcomed.

Rodeo.be’s picture

Yeah, any news on v3 for D6?

ea2391’s picture

Sorry I was wrong.

philipjohn’s picture

Subscribing - and wondering if this issue is likely to get resolved before the v2 API dies on 19th November?

dunx’s picture

Only just come to this and as said, Google Maps API V2 is deprecated in about 3 weeks.

https://developers.google.com/maps/documentation/javascript/v2/

How close is this solution for D6? I can see lots of failed tests. I just wanna draw some circles on my maps :)

Happy to help test if required.

joelpittet’s picture

@dunx I've used this and it works fairly well, give 6.x-2.x-dev a try and if you find a bug, search & report it.

Markiz’s picture

Thank You. I updated to version 6.x-2.x-dev and the map in api version 3 works. Does anyone know, how to turn street view button on?

Markiz’s picture

Issue summary: View changes

Updated issue summary. Added D6 version

mtoscano’s picture

I also updated to version 6.x-2.x-dev and the maps load correctly, with beta5 zoom control disappear.
One question: the map style it is still the old one, not the new with lighter colours, why?

Summit’s picture

Google Maps API v2 and with this Drupal Gmap 6.1 will be depreciated. Please does Drupal Gmap 6.2.dev works correctly?
Is there somewhere a correct upgrade scenario including upgrading from v2 to v3?

Thanks a lot in advance for your reply or link to a correct working scenario. I use Martin Pearman's ClusterMarker for showing clustermarkers on one map, is this still supported?

Greetings, Martijn

Summit’s picture

Hi,
I need Gmap with views.
Please confirm that Gmap 6.2.dev is Google Maps API V3 compatible?
I have it working now, adding third party .js files.
Next to this I needed a clustermarker, and this one worked: https://drupal.org/node/1573062
Greetings, Martijn

izmeez’s picture

@Summit can you further clarify,

I have it working now, adding third party .js files.

Did it not work until you changed some .js files ?
Or were you also trying to add other third party .js files and now have that working.
More details would be helpful. Thanks.

Summit’s picture

Hi,
I use gmap latest 2.dev and location latest 3.dev with views. Indeed it did not work without changing some .js files.

I had it working after adding first the old 6.1 third party files. All sort of .js files. And after this changing markerclusterer_packed.js to http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermana... and using that market manager (GMaps Utility Library MarkerClusterer) I got it working.
I wanted Martin Pearman's ClusterMarker, but that .js and also other ones I found on the internet didn't work.
I also added the API code in Gmap settings.
Is it now Google Api V3?

The only thing what not working is the infobubble..
Any one having the same experience?

Greetings, Martijn

scott_earnest’s picture

I cannot get the infoWindows to open up in my gmap views either.

scott_earnest’s picture

...

scott_earnest’s picture

...

heacu’s picture

i am not getting my info bubble showing up either, with a gmap style view.

heacu’s picture

update:

when using 6.x-1.x-dev, i had admin/settings/gmap set to "Do nothing" as the marker action.

after upgrading to 6.x-2.x-dev, i changed it to "Open info window" and am now getting the window to open.

Summit’s picture

Hi, And how about your post #163, about the info bubble showing?
greetings, Martijn

scott_earnest’s picture

Working with #164. Thank you.

rooby’s picture

This is now a crazy, hard to follow issue of issues.

What exactly is this issue for?

Seeing as google maps v3 has been implemented but has bugs, shouldn't we now close this and stick to having a follow up issue for each bug found?

podarok’s picture

Title: [Needs tests] Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev » [CLOSED] Backport from D7 to use Google maps API V3 for D6 6.x-2.x-dev
Issue summary: View changes
Status: Needs work » Closed (fixed)

due to #167
closing
Feel free to open follow-up issue with possible bugs or support requests and stop post annoing messages to old fixed issue

izmeez’s picture

Well it's nice to see that Gmap 6.x-1.x sites are actually working well today with Google's wrapper for API v3. Having a site with overlays, markers, highlights and tooltips all working fine is a blessing. Especially, after having spent some time trying the upgrade path without success. Still not happy to be using an "unsupported" module but in this case the support from google came through.

Summit’s picture

Hi, I would love to see Gmap 6.2.x working with correct tooltips. All other things are working enough, but gmap views with tooltips not using latest Gmap 6.2.dev.
But I agree to Rooby, that new issues needs be set for these things, is this agreed?
greetings, Martijn

rooby’s picture

@Summit:

Yep, new issues for any problems you find.
podarok already closed this one.