Google map api v3 no longer requires a key to function:
http://googlegeodevelopers.blogspot.com/2010/03/introducing-new-google-g...

I suppose this module needs to be amended to work with V3 as well.
Somehow with no key entered I've been able to use the displayed map to enter geolocation.
The annoying thing however is the key warning that pops up on any page where gmap module is used.
I'm using a development machine on an openvpn, so I'm not sure how to specify the address to use for generating the key.
In any case, shouldn't the key warning popup be removed, it's really annoying, a message on the resulting page would be less 'in your face'.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

fmjrey’s picture

Priority: Critical » Normal
rizzo’s picture

Yep I was interested to read the new gmap API as well.

fsirett’s picture

I have the self same problem and have had for over a week now. the maps all work just fine, but the error:

This web site needs a different Google Maps API key. A new key can be generated at http://code.google.com/apis/maps/.

appears on nearly every page since maps are quite heavily integrated into my site. Thank goodness it has not yet gone live.

As an aside, I did load the Key API and moved the key there. No change. I have also gone through the entire site to find any unmatched keys and there were none. The obvious problems ataken care of there.

I see this is rated as "normal." As I get closer to launch it is going to become quite urgent for me!

fsirett’s picture

I had this reply to the problem on the Googlemaps forums. It does work!

From: Rossko
Date: Jun 29 01:42AM -0700
Url: http://groups.google.com/group/google-maps-api/msg/9d71011d14c03d4c

> I have not been able to find the extraneous script line.

Visit
http://XXXXXX.com/map/user
Use 'view source' in your browser
Look for the fifth or so line
with invalid key, which generates your error prompt.
Remove it.

One of the problems is that you have to do this with each and every page you have a map on. I am now looking for the source of the offending code. I am assuming it is coming from the Gmap module and if I (or one of you!) find this it will make the resolution a bit easier.

kvoltz’s picture

hey guys, I have this same issue. I can't seem to find the script causing the problem. Has anyone been able to tame this error flag?

rooby’s picture

Title: API v3 - no key needed - remove warning » Update to use Google maps API V3
Version: 6.x-1.1-rc1 » 6.x-1.x-dev

This is a bigger issue than v3 not requiring a key.

This module is written for gmap v2 so needs to be updated to use v3.

This is potentially a large issue. I will have a look at the v3 api when I get some time and see what needs to be done. It will also require a lot of testing once we get some patches.
It needs to be done though as v2 is depreciated now that v3 is out.

If anyone has spare time to work on this a checklist of things that need changing or patches would be a great help.

kvoltz’s picture

hmmm. I am guessing than, that there is no simple way to just step back into the v2 environment until that gets resolved?

rooby’s picture

If you are using the gmap drupal module you will be using v2 because it doesn't support v3 yet.

Just use the module as usual (including using the api key), it just won't have any of the new features that are added to v3 until the module is updated to use v3.

v2 is still supported by google, there just won't be any new features added.

kvoltz’s picture

Sure, I'm not concerned with any new features. It does what I need as is. I just need this error to quit popping up. I would be happy with a hack for now. Are there any suggestions?

rooby’s picture

Which error are you referring to?

kvoltz’s picture

I get an error on every page that says the following:

"This web site needs a different Google Maps API key. A new key can be generated at http://code.google.com/apis/maps/."

Same as #3

I have been through the post referred to in #4, but this thread isn't really of any help. I can't track down any of the lines of code they are referring to.

If it were just a message, I would be less bothered, but it is a full error popup that stops the page from loading until you click "O.K."

rooby’s picture

I don't see that error on my site.

A few things to check:
1. What version of the gmap drupal module are you using? 6.x-1.1 is just out so try that.
2. Try regenerating the API key.
3. Is your site available at multiple domains? The api keys will only work for a single domain and the gmap module only allows one key so that can cause problems as it will only work on one of the domains without error.

kvoltz’s picture

Alright, here is the run-down.

I just generated a new key, and updated to the latest version. Sadly I am still getting the same errors.

While building the site, I had it located within a folder on my serverspace, so... www.foo.com/something
Everything worked perfectly initially, but as soon as I got the url - and directed it to that folder, things when awry.

So, the site is now at www.something.co.uk, but its in the exact same place (still at www.foo.com/something)

When this first happened - it was obvious, I needed a new key because the original one was for www.foo.com/something and the new address is www.something.co.uk. I then grabbed the new key, but no dice. I keep getting the same errors, for each page.

i have regenerated the key a half-a-dozen times now, and still no luck. Does that make any sense?

Thanks again for helping out - I'm sorry to keep banging on about this!

kvoltz’s picture

Got it. Apologies. I am a bit of an idiot.

I had a couple other modules enabled that were also using the API key. I changed one of them, but neglected to change the rest.

Sorry to suck up so much bandwidth!

jrb207’s picture

Gmap API 2 doesn't work with touch screen devices like the iPhone and the iPad. Gmap API 3 does. Is there other interest to upgrade the Gmap Module to API v3? I can't seem to find much discussion of it.

fmjrey’s picture

My interest are very simple:

  • No key needed! The less info I give to google the better
  • API v2 is no longer evolving and will die in 3 years:

For a period of 3 years after an announcement (the “Deprecation Period”), Google will use commercially reasonable efforts to continue to operate the Deprecated Version of the Service and to respond to problems with the Deprecated Version of the Service deemed by Google in its discretion to be critical. During the Deprecation Period, no new features will be added to the Deprecated Version of the Service.

New Zeal’s picture

I had a similar problem in that I have just installed gmap location on a site and of course the link to the API key goes to the new V3 page. Eventually I found this: http://code.google.com/apis/maps/documentation/javascript/v2/reference.html and on the left is the link to the API key page. You need to be logged in for that link to work. Click on that and you go to the old API Key generation page.

My suggestion in the short term is to change the link in the module so that is goes to the url above. Provided you put in a valid V2 key then the annoying API key message disappears. You've got plenty of time to update the gmap module to V3.

rooby’s picture

Re #17:
Yeah, the link needs to be updated to be http://code.google.com/apis/maps/signup.html

vlooivlerke’s picture

I think it happned today. All my sites, (over 100) suddenly states " Javascript is required to view this map"

I have not worked on them and they are now broken.

Did google make V2 absolute according to there message on the API page

Note: The Google Maps Javascript API Version 3 documented within these pages is now the official Javascript API. Version 2 of this API has been officially deprecated as per our deprecation policy. We encourage you to migrate your code to this newly updated and enhanced version!

rooby’s picture

@VlooiVlerke:

" Javascript is required to view this map" would not be caused by this.
You have some other issue.

V2 of the api can still be used but won't have any new features.
On this page - http://code.google.com/apis/maps/documentation/javascript/v2/
They say

Note: 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.

nahomadis’s picture

It would be great if someone capable took the bold move and updated the Gmap module to integrate with Google Maps API V3. I'm just such a PHP novice I don't have the ability to do it.

erikwebb’s picture

Priority: Normal » Major

I would be interested in helping to port this to the new API v3. Could the maintainers please create a 6.x-2.x branch for me (and others) to work off of?

rooby’s picture

Why not just make patches against the current version for now?
Otherwise it's just another version we have to maintain for a module that is already behind on maintenance.

Also, I haven't looked into it yet but depending on the scope of the changes between the two versions there might not be any need to create a new branch for this. Unless it is going to be greatly different.

erikwebb’s picture

To me at least, this doesn't seem like something that should be done within a major-release. To be honest, I guess it depends on how much of a rewrite it'll require. If the changes are restricted to new API calls and maybe different data objects being passed, I agree with you.

I've recently been working with the Twitter module, which required a lot of changes to work with the new API over there. Just assumed the changes would be just as big here.

I'll start taking a look at what needs to be done to convert this. Off hand, do you know if anyone else is working on an API v3 version currently? If so, I'd like to collaborate.

rooby’s picture

Yeah, generally I would expect to see a new major release with a new major version of an external library but compared to the size of the module I think (and hope) the code changes might be fairly small, though I'll have a better idea after looking deeper into the new version. I might be very wrong.

Also from the users point of view the settings and differences shouldn't really be noticeable, aside from the lack of API key, which will be awesome.

No, I'm not aware of anyone else doing work on this at the moment.

I'm happy to review any patches anyone can make.

erikwebb’s picture

Assigned: Unassigned » erikwebb

As I'm working through this, should we support v2 and v3 or just v3? I'll need to move my changes around to be a more "pluggable" choice.

I'm finding a lot of functionality differences and renamed properties between the two versions, so I doubt they can fully co-exist.

erikwebb’s picture

Status: Active » Needs work
Issue tags: +API change
FileSize
25.05 KB
None View

I'll be updating this thread with my mega-patch as I go along so we can track changes if I break something along the way.

Massive patch attached (~750 lines). I've rearranged some of the code based on what I considered a "bootstrap_option". In v3, all options should be set when the map is created, so I plan to move all functionality into that event. Any objections?

So far, functionality converted over -
-Basic map setup
-Default size/coords/zoom
-Default map type
-Control type
-Navigation control type
-Removed API key field

Functionality left to implement/test -
-Line/polygon default size
-Highlight color
-Limit available map types
-Map behavior flags
-Marker actions
-Marker managers

ehikr’s picture

subscribing

rooby’s picture

Thanks for the patch.

I haven't had time to look at it yet but re #26 I would think just support v3.
Once there is v3 support there should be no need for people to use v2.

erikwebb’s picture

My only fear with supporting v3 only is if there are applications out there making specific use of v2 APIs. If they would need a patch, how would that work?

From what I've seen so far, if you've done a lot of custom work around v2, it would require a large amount of rewriting to be compatible with v3.

hutch’s picture

v3 is really good in some respects but has yet to develop in others, draggable markers for instance are pretty poor. Also there are plenty of third-party apps such as the various marker managers that have AFAIK not yet been ported to v3.

Rewriting the existing gmap/location modules to handle both might prove too difficult so perhaps a new version for v3, written from scratch and with fewer but better and more integrated features might be the way forward. Both gmap and location suffer from the consequences of "creeping featuritis", too many bits added in a helter-skelter manner with little overview. The individual components are often brilliant but they all too often don't play well together, so for instance getting the marker you select for use to actually be used can be a hit-and-miss affair.

te-brian’s picture

FileSize
17.72 KB

re: #31

I tend to agree with hutch . My old V2 map implementations and custom little module hook-ins and such would not all translate to V3 (at least, not yet). I would propose that in order to make a clean move to V3, a new gmap 2.0 (or should we skip to 3.0?) branch should be started.

I see two options with this 2/3.0 branch:

  1. We port to the V3 API as directly as possible. This would allow the gmap API as a whole to remain as unchanged as possible. Most likely some features will be removed or streamlined (due to changes in the underlying API), but all in all we would try to keep the functionality identical to the 1.0 branch.
  2. We consider a brand new approach for V3. This would allow us to re-work the API to include some new philosophies and we can develop the D6 version with D7 directly in mind (so the two versions can function similarly).

My vote would be for option 2. I would prefer to see the gmap module move more in the direction of open layers/feeds/views/etc. IMO the most forward-thinking modules are ones who take a plugins/exportables/ctools approach to their APIs. Along those lines, I have attached the beginnings of a map module I have been working on internally. It depends on CTools and is based on the following basic ideas:

  • Integrate with the CTools export and export_ui to allow both code and db versions of map configurations.
  • Take an OOP approach to the maps and map contents (easy to override individual parts).
  • Uses the CTools plugins API to provide map 'Layers' (markers, kml, etc.), and in the future 'Styles' (marker icons, kml colors, etc.)
  • Uses jquery.class.js to allow the javascript portion of the module to parallel the OOP structure of the map, layers, and future plugins (http://ejohn.org/blog/simple-javascript-inheritance/)

By no means is the module complete (Hint: Do NOT use in production) but it should give you an idea of the type of structure I envision. For my projects, I really need this type of extendability and structure, as we are constantly taking the basics and tweaking it here or there.

I love everything that has gone into the gmap module and would much prefer to expend my efforts on a widely used module. However, going forward and into D7, I think it could benefit from a refresh.

Just my 2 cents :)

hutch’s picture

I'll have a look at map.zip ASAP ;-)

te-brian’s picture

FileSize
18.32 KB

Just attaching an updated map.zip. The version uploaded in #32 had a few bugs.

izmeez’s picture

subscribing

jdidelet’s picture

+1

erikwebb’s picture

Assigned: erikwebb » Unassigned

Looks like there are better options than my direct API port idea.

te-brian’s picture

@erikwebb - I wouldn't write it off so quickly. My particular needs may not match up with the general gmap user base. In fact, maybe most people just want a quick port.

csuggs4’s picture

+1

Magnus’s picture

Subscribe

pacome’s picture

Subscribe

Once it will be updated to V3, we should be able to use the Google Maps API Styled Map Wizard, right ?
(here : http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index...)

If yes, that's super great ! :)
-p-

fabianderijk’s picture

subscribe

I also want to use the v3 api, you can do some cool stuff with it.

rooby’s picture

Still haven't had time to review the patches here but it definitely seems like we should keep 6.x-1.x & 7.x-1.x for maps api v2 and use 6.x-2.x & 7.x-2.x for maps api v3.

That will give us more liberty to rewrite things for v3 instead of just mashing it into the current code.

Then we can just do a direct port of 6.x-1.x to d7 so it is available sooner, then take as much time as required to do the api v3 branch.

hutch’s picture

rooby's comments in #43 strike me as a clear definition of the way forward, v3 still has some issues, eg movable markers for one.

erikwebb’s picture

I think as v3 evolves, we need a GMap version that is in-line and can grow. I think a limited functionality 6.x-2.x (maybe not even listed as recommended yet) is the proper short-term solution.

I don't feel comfortable helping with a rewrite, primarily because of my lack of JavaScript skills. Releasing a "ported" v3 version, then re-writing within the same branch seems like bad practice. I think this is the best way to go, so if I can help much on the PHP/Drupal site, I'll look to help.

te-brian’s picture

RE #43 and #45

I think this is an excellent idea. A three-prong approach could be taken:

  1. 6.x-1.x / 7.x-1.x -- Finished porting v2 functionality to D7.
  2. 6.x-2.x / 7.x-2.x -- Port v2 functionality to v3 as directly as possible (quick)
  3. 6.x-3.x / 7.x-3.x -- Bleeding edge v3 support with updated/re-imagined API (long-term)

The difficulty will be making sure people understand the differences and also realize that everything that is possible with v2 has not been implemented in v3 yet. They are, in fact, completely different APIs.

rooby’s picture

I'm not sure I understand the need for two v3 branches.

I would think it would be less confusing if there is one branch for each and v3 brach isn't recommended until it is up to scratch. And have a notice on the homepage stating that the 2x branch is still under construction and not feature complete.

It would also be easier for anyone developing/testing/committing patches to have less different branches.
Having two new branches under construction spreads peoples time thinner than it already is.

It would be good to get bdragon's opinion on this too.

haopei’s picture

Subscribing.

fith’s picture

Subscribing.

viren.ratan’s picture

Subscribing

lebodyguard’s picture

Subscribing

geoill’s picture

I am very interested in utilizing the new Google maps 3.

EgbertB’s picture

Subscribing

bumathan’s picture

subscribing

FiNeX’s picture

subscribe

EvanDonovan’s picture

I agree with rooby in #47 - there should just be a v3 branch, and it won't be recommended until the issues are sorted. That shouldn't take longer than the "deprecation period" anyway.

Otherwise that is a lot of branches to maintain, especially considering the need for concurrent 6.x and 7.x...although maybe Git would make it easier?

circuscowboy’s picture

Well it seems that a new branch should be made so that development can at least start. I can lead a the new update but I can help.

Scott

bumathan’s picture

Good news, Thank you circusboy.

hutch’s picture

The bulk of the changes will be in the javascript plus any php controlling code. One of the harder things to replace will be the markermanager I imagine, I see nothing comparable in Googlemaps API v3.

At a quick look gmap.js seems to be where the maps are generated so it will have to be rejigged as gmap2 functions like addControl, setCenter and setMapType have gone and the settings will have to be fed into the map options when the map is created and not afterwards. Hopefully the essential structure of gmap.js will be retained.

Anyway, a good start would be 2.x-dev branch(es).

My two bits worth.

EvanDonovan’s picture

@hutch: Yes, sorry, when I said v3 branch, I meant a 2.x branch of the module that uses v3. (Too much confusion possible between branch version # and the version # of the API.)

There is no markermanager in v3? Even if not native, is there maybe a third-party library? That could be recommended/required then and added using Libraries API.

hutch’s picture

@EvanDonovan, I haven't found a markermanager anywhere yet for v3, perhaps there is one somewhere or it's a good project for "Summer of Code" ;-)
I converted the v2 code in my Getdirections module to v3 but that code is *much* simpler than gmap, it might help to eyeball the js to get some idea of where the changes will lie.

boran’s picture

I just tried to use Gmap 7.x-1.x-dev and cannot get an API key accepted on admin/config/services/gmap.
The key being generated on http://code.google.com/apis/maps/signup.html.

Have I misunderstood or is gmap broken since google published v3 last year?

EvanDonovan’s picture

@boran: GMap is not broken. I would imagine you are having an issue with misconfiguration on your end.

mry4n’s picture

Subscribing

youngelpaso’s picture

Subscribe

navarrete’s picture

+1

pjcdawkins’s picture

Subscribing

matjam’s picture

Subscribing

Fidelix’s picture

Subscribing...

Beanjammin’s picture

+1

DeeZone’s picture

Subscribing

RedTop’s picture

subscribing

brunorios1’s picture

subscribing

MXT’s picture

subscribing

khaled.zaidan’s picture

subscribing

memoo’s picture

subscribe

RedTop’s picture

sub

onewomanbiz’s picture

subscribe

bertboerland’s picture

Note this would also make it possible to use Google Maps on a HTTPS site without warnings and without buying the 10k Premium version. http://code.google.com/apis/maps/faq.html#ssl

HnLn’s picture

sub

stefano73’s picture

FileSize
216.68 KB

Attached file is API V3 porting for current 6.x-1.x-dev.
Needs some more work on in macro builder (marker placement and align).

nikkilabrum’s picture

subscribing

good_man’s picture

subscribe

kevee’s picture

stefano73’s picture

FileSize
216.93 KB

Latest updates:
- added insert/remove for markers in the Macro Builder
- fixed location pick in node edit form.

stefano73’s picture

FileSize
217.05 KB

Latest updates:
- fixed marker icon properties;
- added marker shadow.

hutch’s picture

GMap Module could do with 6.x-2.x-dev and 7.x-2.x-dev as a repo for v3 changes, would the maintainers please consider this, as suggested in #43
Google maps API V3 is maturing rapidly and Gmap needs to catch up.

EvanDonovan’s picture

Till that happens, you could use a sandbox potentially. I think you can have multiple contributors (and an issue queue), and then you can just update this issue with your progress.

kugta’s picture

Subscribe

hutch’s picture

I have recently released a new module, Get locations which contains code borrowed from Gmap, in particular the marker code in gmap_markerinfo.inc and icons.js.
These have been adapted to use Google API v3 along with the marker ini files and could be ported back to Gmap once there is a branch to port them to.

jasongrimes’s picture

Subscribe

arija’s picture

Subscribe

heshanlk’s picture

sub

jkirk’s picture

Subscribe

arcane’s picture

Subscribe

andrea.brogi’s picture

subscribe

boran’s picture

no more "subscribes" please, use the follow button on the top right :-)

wxman’s picture

Does the patch in #86 work with this patch: http://drupal.org/node/429330#comment-4342992 ?

I gave it a try, and I'm getting the "Javascript is required to view this map." on every place there's a map.

FIXED:
Never mind. I was able to get both to work. It only took a minor change in the HTTPS patch. Now version 3 and HTTPS are both working. Thanks for the API 3 version.

arcane’s picture

Could you let us know what you did to get everything working?

healycn’s picture

Subscribing

wizonesolutions’s picture

Don't subscribe with comments anymore; use the green Follow button at the top-right of the issue.

mtchetch’s picture

FileSize
2.4 KB

No info Windows? No problem :)

To get gmap V3 to play nice with views and clickable markers (that show the info window) I changed the file marker.js.

The changes enable the marker to be clicked and the info window to be created on click. Only one window at a time, previous windows get closed when you click a marker.

Just replace the gmap/js/marker.js found in comment #86 package and you get basic info window functionality.

Come on, join in and lets get Gmap fully working with the V3 Api

wxman’s picture

FileSize
40.91 KB

Sorry, I can't make a proper patch. I can attach the fixed gmap.module file. This is the API 3 version with http://drupal.org/node/429330#comment-4342992 applied. I had made a slight change in the patch, but being the fool I am, I forgot to document my fix.

ionut.stan’s picture

Solution #86 works perfectly! Congratulations!

arcane’s picture

Using #103, I had to comment out lines 1322 to 1329 because I was getting an Fatal error: Cannot redeclare template_preprocess_gmap_view_gmap() since it was already declared in gmap.views.inc

The code that was commented out is shown below:

function template_preprocess_gmap_view_gmap(&$vars) {
   $vars['map_object'] = $vars['rows'];
   // Rows is actually our map object.
   unset($vars['rows']);
 
   // Theme the map.
   $vars['map'] = theme('gmap', array('#settings' => $vars['map_object']));
 }
spgd01’s picture

subscribe

oren102’s picture

With a little modification to #86, I was successful with complete https switchover.
All I did was change the "http" to "https" in the "/sites/all/modules/gmap/gmap.module" file.

Thanks a lot!

allukraine’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Why has stopped the development of the project? Should I expect not beta version for Drupal 7?

ipwa’s picture

I think we should start testing out #86 and reporting back here. If a couple of more people test it too, I can do a diff patch so we can mark the issue as "needs review" for the maintainers attention.

SeanA’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Restoring version.

allukraine’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

If "gmap_v3_1.zip contains versions of modules or themes that are not compatible with Drupal 7.x: GMap Taxonomy Markers, GMap, GMap Macro Builder, GMap Location" - in this case, it can be checked with Drupal-7?

izmeez’s picture

@ipwa, a patch would allow more review and testing. Thanks.

SeanA’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

@allukraine, the code in question is for Drupal 6, therefore the code posted here is not compatible with Drupal 7. Changing the version will not make development move faster if there is no D7 code yet for this. Please leave the version at 6.x while work is being done in this issue to get these fixes into the D6 version of the module. (If you need this for D7 right away, best option is to hire a programmer to implement it for you and contribute the code back to the module.)

dafeder’s picture

Status: Needs work » Needs review
FileSize
46.1 KB
None View

Folks, to speed this along I've created a patch from #86 - haven't done any testing myself yet.

dafeder’s picture

First observation: autozoom does not seem to work.

dafeder’s picture

Here's a new patch to fix autozoom. Assumes that #114 is already applied.

dafeder’s picture

Sorry, some cleanup I forgot to do in that last patch. Doesn't have any ill-effects but this one is cleaner.

dafeder’s picture

Info windows are still using all the old V1 methods, so those aren't going to work unless we rewrite all of that.

EDIT Sorry, missed #102. I'm going to put this all together into a single patch.

dafeder’s picture

Here is a new patch combining #86 and #102. #103 seems to be quite broken to me so I did not include it.

dafeder’s picture

Ugh, I really do apologize folks, posted too quickly again. Please use this one.

greggmarshall’s picture

dafeder

What should I apply this patch against? I tried it against the latest 6.x git repository and got a whole bunch of git errors...

apiv3.patch:26: trailing whitespace.

apiv3.patch:30: trailing whitespace.

apiv3.patch:32: trailing whitespace.

apiv3.patch:279: trailing whitespace.

apiv3.patch:285: trailing whitespace.
};
error: patch failed: gmap.module:1318
error: gmap.module: patch does not apply
error: patch failed: gmap_settings_ui.inc:1
error: gmap_settings_ui.inc: patch does not apply
warning: js/address.js has type 100644, expected 100755
warning: js/align.js has type 100644, expected 100755
warning: js/gmap.js has type 100644, expected 100755
error: patch failed: js/gmap.js:194
error: js/gmap.js: patch does not apply
warning: js/gmap_marker.js has type 100644, expected 100755
error: patch failed: js/gmap_marker.js:1
error: js/gmap_marker.js: patch does not apply
error: patch failed: js/icon.js:1
error: js/icon.js: patch does not apply
error: patch failed: js/locpick.js:10
error: js/locpick.js: patch does not apply
warning: js/macro.js has type 100644, expected 100755
error: patch failed: js/marker.js:1
error: js/marker.js: patch does not apply
error: patch failed: js/markerloader_static.js:1
error: js/markerloader_static.js: patch does not apply
warning: js/overlay_edit.js has type 100644, expected 100755
warning: markers/days.ini has type 100644, expected 100755
warning: markers/route.ini has type 100644, expected 100755
warning: thirdparty/README.txt has type 100644, expected 100755

hutch’s picture

I just tried this (on ubuntu box):

git clone --branch 6.x-1.x http://git.drupal.org/project/gmap.git
cd gmap
wget http://drupal.org/files/gmap_apiv3_autozoom_infowindow-818638-120.patch
patch -p1 < gmap_apiv3_autozoom_infowindow-818638-120.patch

The output was

patching file gmap.install
patching file gmap.module
patching file gmap_macro_builder.module
patching file gmap_settings_ui.inc
patching file js/address.js
patching file js/align.js
patching file js/gmap.js
patching file js/gmap_marker.js
patching file js/icon.js
patching file js/locpick.js
patching file js/marker.js
patching file js/markerloader_static.js
patching file js/overlay_edit.js

Looks OK to me.

dafeder’s picture

Patch was against latest 6.x-1.x-dev release. Perhaps you're still on 6.x-1.1?

eMuse_be’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Subscribing

izmeez’s picture

@dafeder, patch in #120 applies to gmap-6.x-1.x-dev and appears to be working. Will need to do more testing to confirm if it also works with gmap_addons or if that module will need changes to match.

izmeez’s picture

Just wondering with the advancement of the patch for 6.x to use api3 if it's time to make a commitment to a new branch? Personally I think it would make sense to jump to 6.x-3.x-dev for the new branch.

SeanA’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

@dutchiexl, please don't change the version: the code here is for D6. (Subscribe comments are no longer necessary, you can click the "Follow" button instead.)

haiiro.shimeji’s picture

I made the patch code for D7.
http://drupal.org/node/1459606

The followers who use D7, please review this code.

leewoodman’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

subscribing

nairb’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
vlooivlerke’s picture

How about a download link for us lazy people who just want to untar, play and comment.
D6 please. My patching skills suck

aasarava’s picture

Patch in #120 applied to the current 6.x-dev works for me. Thanks! It might be worth adding optional support for keys back in, though, for users who have purchases a license to serve more than 2500 map requests per day.

rooby’s picture

Agreed, it needs to support the business key.
Although the limit for the free service is actually 25000 a day.

Pls’s picture

FileSize
1.45 MB

dafeder, you've done amazing work. Thanks for that. We really appreciate it.

Attached tar file with current gmap 6.x-1.x and applied patch from #120. Please test and report back. For me it works without any problems. Thanks!

sano’s picture

Thank you Pls. The only problem I see so far is that the module you prepared is not showing version number on the module list page. This is a small price to pay for the convenience though :-)

rooby’s picture

If it has been checked out from git it doesn't have a version number as it isn't a specific version.
It is just the latest code as of when it was checked out.

You can add a version yourself to the info file so you know.
Just add a line to the info file like
version = "6.x-1.x-dev"
You could include a date in the version number to make it more useful.
Or include an extra line in the file:
datestamp = "1301616521"
With the current unix time stamp.
You can get a timestamp from http://www.epochconverter.com/

guero_jc’s picture

Hi guys, received a cordial greetings from Guadalajara Mexico. I did what you said about the patch, install the module as an upgrade from V2 to V3 API and mapping work and even in the views, but the problem I encountered is that clicking on a globe of information, not displays any action (such as: Do nothing, Show information, Open link to the node), including enabling or disabling the module administration page.
I hope to see my comment and try to update this function module.
I think do an excellent job
THANKS

guero_jc’s picture

Hi guys, again with some news about the update that made the gmap module.
In the section "Gmap macro creation" does not work any action in the section "Overlay editor," there before, you could create filled polygons, lines, circles, or dots, but nothing works. Do not think it's limiting V3 google maps api. I pass the data from this, since it is a very important function in gmap. I do not program in php, but I was looking at the code, and if I notice some changes, I believe that there may be the problem.
Thanks

guero_jc’s picture

Hi guys, and follow the news on the update to the gmap module.
In the V2 API, you could create filled polygons, and when the node accedias, I showed the map with the polygon fill, now it does not, check in paragraph format types, and is correct and select the "Gmap macro expander. "
Thanks

vlooivlerke’s picture

hi, I cant get my taxonomy markers to work.

Cleared all caches and regenerated makers did update but no markers in views.

pepe84’s picture

I have the same issue #137

truyenle’s picture

FileSize
42.75 KB

patch from #120 and instruction from #122 works for me with 6.x-1.x-dev. However, there is an issue with location module.

I use location with gmap. Location help to pick up location by enable "Use a Google Map to set latitude and longitude" under Location module.

The map for pickup location look weird see image. If I drag and drop the map, seems doesn't work.

I'm not sure this is the issue of Gmap or Location, properly the location. I'll shoot this to location module issue queue also.

Thanks

Update: the issue is reported here in location module http://drupal.org/node/1509900

pepe84’s picture

@guero_jc have you tried to enable the marker action? This issue has been driving me crazy for 2 days and it results that I forgot to enable it at gmap location module settings page (/admin/settings/gmap_location). :S

Marker action:
[ ] Do nothing
[X] Open info window
[ ] Open link
Perform this action when a marker is clicked.

Cheers,
Pepe

guero_jc’s picture

Hi pepe, yes, I've tried setting the action, but does not work quite right. Everything is configured correctly, but still, not working "overlay editor" when you create a gmap macro.
Thanks and regards

asiby’s picture

OYE OYE ... I HAVE FOUND THE WAY TO GENERATE AN API KEY FOR THE GOOGLE MAP API v2

Guys, I am sorry to burst your bubble but you are not hallucinating. It is indeed still possible to get an API Key for the Google API v2. I will try to keep the explanation brief and concise.

  1. Display the page at https://developers.google.com/maps/documentation/javascript/v2/introduction
  2. You would really want to read the deprecation policy linked in the note left by Google in that page. The direct link to the policy is https://developers.google.com/maps/terms#section_4_4.
  3. Click on Obtaining an API key
  4. In the second paragraph, click on the link that is in the sentence "To create your API key, visit the APIs Console at https://code.google.com/apis/console and log in with your Google Account." (what the heck, you can also click on it here. lol). After clicking on the link, you will be taken to the Google APIs Console. However, at first, you might simply see a Google login page because you need to login with a Google account. I tried successfully with a Gmail and a Google Apps account. And I think it is worth mentioning that the billing options are disabled in my accounts.
  5. If you didn't login yet, do it now.
  6. (Only when applicable) If this the first time you use this console, than you will need to go through the one-time activation process. You should see an obvious message saying "Start using the Google APIs console to manage your API usage". In that page, click on Create project ....
  7. If you already went through this on-time process for other Google services in the past, then all you need to do is to click on Services in the left menu.
  8. The page should now display the list of all the services that can be managed using the APIs Console. Scroll down and find Google Maps API v2 then enable it and review and accept the terms of service. Do not be intimidated by the pricing link. He he he. As you can see, Google has been generous enough to give you a staggering 25,000 queries/day. Beyond that limit, I would assume that you will be earning money from your site and you wouldn't mind paying for the over usage. After accepting the terms of service, you will be brought back to the APIs Console.
  9. Click on the API Access menu item found in the menu on the left
  10. Under the section named "Simple API Access", you should see an API key that you can copy and simply use with the Gmap module or any other implementation of Google API v2.
  11. Have fun fellows!!!

These steps worked for me. I sincerely hope they will for you.

Depending on the lifespan of your project, the date mentioned in the Google's deprecation policy might give you some breathing room all some extra time while the module is being migrated to the API v3.

Good luck guys.

Asiby

webservant316’s picture

I wish I was having the same success.

I also had found the https://code.google.com/apis/console and added the map v2 service and generated a key for my new install of gmap. It was working yesterday, but quit working today. I checked all my settings and generated a new key but got this message "Status: Active until Apr 27, 2012 6:32 AM" Not cool. One day of service!?!? Sorry that status applied to the deleted obsolete key replaced by my new key. Though this problem continued... Furthermore when I installed the key in http://mywebsite.com/admin/settings/gmap it appeared to be accepted. However, when I hit a page displaying a map I get this error...

Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introductio...

Wow what is up?

Jeff

webservant316’s picture

This article seems relevant about a missining 'sensor' parameter which my gmap install does not seem to have either http://groups.google.com/group/google-maps-api/browse_thread/thread/a7f1....

I know that this post is far off the issue title topic. But the larger issue under discussion here seems to be how to get this module to work with google map versions and keys. Shall I start a new thread?

webservant316’s picture

ok my problem explained & solved here - http://drupal.org/node/1549272

carlodimartino’s picture

This is not working for me any more from today. The Google warning pops up after 5 seconds or so and the map disappears. I've generated new keys but same problem.

radoya’s picture

I had same issue today. I find that I didn't correctly set refer sites. I had something like this:
sitename.com
sitename.com/*
As I change it to way sugested from google like this:
*.sitename.com
*.sitename.com/*

Everything apear fine.

I left it in this way for any case:

sitename.com
sitename.com/*
www.sitename.com
www.sitename.com/*
*.sitename.com
*.sitename.com/*

and it saved an issue and maps now apear as expected withouth prompt.

Scrat000’s picture

Thanks, this solution worked for me!

carlodimartino’s picture

Thanks, this solution worked for me too!

asiby’s picture

#145 works. I did it over 5 times while writing the instruction to make sure that I explained it properly.

sioux’s picture

#145 alone was not enough, I edited it as #150 shows, and it took care of it.

ChrisValentine’s picture

My map was working OK but someone abroad reported the JavaScript failure popup thinking it was a Firefox 12 issue. I changed the domain entries as suggested in #150 and it stopped working on my machine too (Firefox 11 or Chrome), with Drupal reporting that "Key for 'google_maps' @ '[my domain and page]' doesn't exist."

I'm using:

  • GMap 6.x-1.1
  • Location 6.x-3.x-dev
  • Keys 6.x-2.1

However, if I only put the one domain in to Keys (without www) - in contradiction to #150 it starts working again. So it looks like it might be a bug in the Keys module.

sithu89’s picture

Thank ,...

rajendra333’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

# 86 gmap_v3.zip working fine i have used.

rajendra333’s picture

thank for your code because gmap module not support v3 version

SeanA’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Code in this thread is for 6.x version.

Gastonia’s picture

It's two years today that I have been a part of this thread. Just curious, would it not be more advantageous for us to work together to write a new module from scratch? By the time 6 is ready, D8 will be out. An attempt to patch D7 after this would put this module basically obsolete :/

Location + Gmap is a huge part of my architecture for my clients. I am very sad to see the words 'Legacy module' applied to the description of Gmap.

I am very willing to help with a new architecture if there is one underway. If there is not, how about lets get one started? Preferably D7. Sorry for the slight tangent. With our heads together as a community surely we can breathe new life into this current Frankenstein.

ipwa’s picture

I used to be a big fan of this module but now I use OpenLayers in which you can use gmaps (v3 interface) too.

I know there is some development of the Location module for 7.x, but there is a lot of good stuff that works well already out there.

Geofield is a good module that works very well. It gives you a geolocation field, that allows for multiple ways to input the location. I think fields is the best approach (that's something that always bugged me about the Location moduke), just look at what happenned to Taxonomy in D7. One of the ways to input the data is by adding a point to a map, there are also a variety of ways to display that data including a map. The module doesn't have map support (I think other than HTML5) by itself, but it works well with OpenLayers and Staticmap (for simple maps).

I guess what I'm trying to say, that there isn't a whole lot of value on porting this module to D7. There are already solutions that will work with Location on the future for example (Staticmap), that provides Gmaps among other map providers.

For simple Location+Gmap replacement use Geofield + Staticmap.

2pha’s picture

I too have moved on from this module, usually using geofield with openlayers. Though I have started just using the google maps api to make the map myself as it is so easy to use.

webservant316’s picture

Can Geofield and/or Static map provide both a single marker on a node map and multiple markers on a Views oriented map? Currently I use gmap to put a single marker on a map on a node and then use Views to put multiple markers from those nodes on a single map.

ipwa’s picture

Though I have started just using the google maps api to make the map myself as it is so easy to use.

The reason I don't do this is because then I don't get the geolocation stored on my Drupal nodes, which is cool, and can be taken advantage of by Google (showing results on map searches).

Can Geofield and/or Static map provide both a single marker on a node map and multiple markers on a Views oriented map?

Not entirely sure if Staticmap supports Views yet, with OpenLayers though, I have done what you describe many times.

2pha’s picture

The reason I don't do this is because then I don't get the geolocation stored on my Drupal nodes, which is cool, and can be taken advantage of by Google (showing results on map searches).

That is what geofield is for.

donpwinston’s picture

Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v2 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key

Unreal. What the heck is going on?
I'm an unable to generate a valid api key. I've done it before two or three times about 8 months ago. What's changed?

ChrisValentine’s picture

Unreal. What the heck is going on?
I'm an unable to generate a valid api key. I've done it before two or three times about 8 months ago. What's changed?

I'm getting random reports from my users that the embedded map doesn't appear and they see an API error - while for other users its working fine. Days later, without having done anything, its working again. I can only guess its Google fiddling with the v2 API - perhaps encouraging us to migrate to v3!

Would like to see a working, stable, API v3 solution to geolocation and mapping for Drupal 6.

matiaslezin’s picture

#150 worked for me!

AtomicCharles’s picture

#150 seems to be the accepted solution (and it works for me)

rhimes’s picture

Has anyone successfully used this patch (#120) for Gmap Api v3 on a local test enviroment site (Xamp/Wamp setup) which had previously been using a v2 Api Key?

Wanting not to commit the patch to my production sites until I tested it locally (I use Xamp), I applied #120 patch to my local test site "newsite.loc" which had been previously generating all maps successfully with a v2 Api Key (got v2 key the "old" way for test site prior to code.google.com/apis/console method).

After applying patch, maps @ "/map/user", "/admin/settings/gmap" and "/user/X/edit" (@ "Location" fieldset, have "Use a Google Map to set latitude and longitude" enabled) no longer load, only light grey areas appear where maps had been showing - see attached screen shots.

Also attached are screenshots (2) of the page source of /maps/user showing what I believe to be the correct js script source and map data that indicates there should be two map markers on the missing map.

quwat’s picture

1. log in to https://code.google.com/apis/console/
2. Create New Project
3. Under Services - turn on only Google Maps API v2
4. Click on API Access link on the left side
5. Click on Create an OAuth 2.0 Cleint ID , the blue tab in the center
6. Brand your API i.e Product X (Your brand name) and your logo at
http://www.example.com/sites/default/files/logo.jpg
7. Click Next and click Web Application and leave your web address in the host name (www.example.com) and click on Create ID tab
8. Click on Create New Browser Key tab at the bottom.
9. In Accept requests from these HTTP referers (web sites) space: Put the following addresses of your web site
*.example.com
www.example.com/*
www.example.com/admin/*
1. Click create the Key tab
2. Copy your API key and Paste in http://www.example.com/admin/settings/gmap
3. Hope this works for Drupal 6

youngelpaso’s picture

ChrisValentine, check out: https://developers.google.com/maps/faq#ssl Unless you're a Google Maps API for business user you can't get API V2 over https - this will lead to 'javascript is required to view this map' error and no map. So, for your users visiting pages over HTTPS that's probably what's happening, and those over http are probably fine. Hence the semi-randomness of their experience. I'm dealing with the same issue. Good luck!

ChrisValentine’s picture

Interesting - wouldn't have thought of that!
I'm in the process of migrating the site to Drupal 7 and had replaced the GMap Module with Get Locations instead - which uses API3.

donpwinston’s picture

Why didn't you dump Gmaps altogether and use OpenLayers? I was able to convert everything in my project without difficulty. I was under the impression that GMaps is defunct.

dotpex’s picture

http://drupal.org/node/818638#comment-5771082 work for me, with replaced marker.js from d7 version.
v3 api work over https without key!!!
We use domain module and ssl per domain, this works for me.
In gmap.module add

function gmap_protocol() {
	global $_domain;
	if (isset($_domain['scheme'])) {
		return $_domain['scheme'];
	} else {
		return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
	}
}

And changed two lines
328

drupal_set_html_head('<script src="'. check_url(url(gmap_protocol().'://maps.google.com/maps/' . $file, array('query' => $query))) .'" type="text/javascript"></script>');

1118

$data = drupal_http_request(gmap_protocol().'://maps.google.' . $tld . '/maps/geo?q=' . drupal_urlencode($address) . '&output=csv&key=' . $key);
merch’s picture

Using #134 http://drupal.org/node/818638#comment-5771082
Maps working generally ok

Problems with views not having a on click state on pins.
problem with views not highlighting pin of focus.

I can live without the highlighted pin but does anyone know how to fix it so that click on pins will show view information (title image ect)

dotpex’s picture

FileSize
1.81 KB

Try with this marker.js from d7 version of module, work for me.

rfay’s picture

Category: feature » bug
Priority: Major » Critical

Google has sent out emails reminding us that the formal deprecation period for v2 of the API ends in May, 2013, after which they suggest that v2 won't work at all. Time to get this in.

I have a legacy site that uses this with a view and it works fine... would rather not have to rework it.

Moving to "Critical" and "Bug report" as it's no longer a feature request but fundamental requirement.

Needs to be done for 7.x as well.

vlooivlerke’s picture

Hi could you please attach your working version, I have used the above supplied files but the patches that was released afterwards well some work and some don’t.

Specially taxonomy markers in views

Thanks

dotpex’s picture

I replace module with one from #134 and then replace markers.js from d7 version of module, but we don't use taxonomy markers or views for displaying data on gmap, only custom code and domain module with some domains work over https.

betson’s picture

Category: bug » support

Hi,

I am new the drupal. My client told me the update the google map version. So I checked the site. There is a lot marking and all there. So I tried to update the V3 version with the help of this thread. Now the map is displaying . But there is no marker coming and map is not showing with the db values of lattitude and longitue. Can anybody give me full code here. Is there any change needed in any other module to show the markers and locations?

rooby’s picture

Category: support » feature
slv_’s picture

Category: feature » bug

I agree with rfay (http://drupal.org/node/818638#comment-6869634) in that it's got to be treated as a bug, since most of the staff in V2 (if not all) might stop working after the deprecation date. Won't change again if a maintainer thinks it's a feature request, but I'll switch the category back to bug report for now, might be easier to prioritize things.

Cheers.

tmsimont’s picture

As far as I can tell by reading this thread and looking at the code, api in use should be v3 for 7.x-2.x-dev, but for some reason whenever I view my maps, I get this message:

Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v2 on this site. If you are the owner of this application you can learn about obtaining a valid key here...

However, the map still works...

Why does this message appear if the map is supposedly using v3 api? What am I missing here?

Sylvain_G’s picture

Just tried out 7.x-2.x-dev... my map is broken

No markers, no vectors, only background layer... seems far from production ready to me.

Lot's of v2 Objects in js code :(

I'm quite worried

tmsimont’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev

If I omit the key in 7.x-2.x from the settings, the map works without error on v3 API, but what key does it use?

I see a lot of critical issues with this module, and a lot of users reporting here with an urgent need for v3 API, but no status updates from maintainers. There's much work to be done here but I see it's been 11 weeks since the last commit.

I looks a lot like this module is abandoned in favor of these modules:
GeoField
OpenLayers
GetLocations

But I must say it would be nice if this module still worked... Can a maintainer report any plans for this module? Has it died?

If there's still life in this module, we should really get a roadmap put together for how this will get fixed. I've changed the version to 7.x-2.x, because AFAIK the "Drupal way" of comittting fixes is to fix the latest version and then backport. I know a lot of code here is for 6.x, but this issue is also almost 3 years old.

A lot of sites are probably starting to upgrade from 6 to 7, so I think we should get a functional 7.x branch, and then if 6.x is even still supported by the time that gets worked out, we backport.

Any thoughts from those involved would be great.

Thanks

tmsimont’s picture

tmsimont’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
magpoc’s picture

#120 workd well for me but only when I set not to use any Marker Manager in admin/settings/gmap
If I set to use the Marker Manager, no markers will appear on my map.
Can't I use the patch with Marker Manager setting?

Anyway thanks for the effort.

podarok’s picture

Status: Needs review » Closed (duplicate)
iancawthorne’s picture

Isn't #1459606 for Drupal 7 and this issue was for Drupal 6?

podarok’s picture

vodoleq’s picture

#134 worked well for me but how to apply my custom Styles and change a few colors on the map from
http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index...
in which files and where to make changes?
Thanks!

donpwinston’s picture

OpenLayers works just as well and is actually a little easier to configure. No API keys also.

Summit’s picture

Am I not correct that Google V3 Api doesn't need APi Key anymore also?
Greetings, Martijn

tmsimont’s picture

yes that's correct. it's optional. you can enter it if you want metrics.