An attempt to help push this project toward openlayers release 2.10 and google maps api v3.

For some reason google maps will not show up without the following line of code in google.js
options.projection = "EPSG:900913";
Without that line this error message appears - TypeError: this.projection.getUnits is not a function

Another thing I'm not sure how to explain: the map tiles seem to move before the markers, lines etc.

I will continue to research.

References:
http://openlayers.org/blog/2010/07/10/google-maps-v3-for-openlayers/
http://code.google.com/apis/maps/documentation/javascript/basics.html
http://trac.osgeo.org/openlayers/wiki/Release/2.10/Notes

Comments

nathaniel’s picture

The lag between Google tiles and overlays is a deeper issue with API v3 please star this issue to help expedite the process:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=2189

Ref:
http://trac.osgeo.org/openlayers/ticket/2929

Eronarn’s picture

These patches enabled me to make use of the dev version of OpenLayers, which includes the new getFeaturesByAttribute function. This is very useful with Views integration because all of the Views fields are stored there. So, thanks very much for that!

In addition to the pan lag issue, I'll point out that there is an attribution popup issue: http://www.mail-archive.com/openlayers-dev@lists.osgeo.org/msg00496.html

They have several solutions there, but I thought they might come in handy to someone else.

christiaan_’s picture

Thank you for this - After applying the patch, there were several pop-up credit windows appearing on the Google Maps.

I added ?v=3.2 to the Google Maps URL in google.inc and the pop-ups disappeared.

So the google URL in the patch for google.inc changes from

http://maps.google.com/maps/api/js?sensor=false

to:

http://maps.google.com/maps/api/js?v=3.2&sensor=false

if you need Google Maps SSL support (now available to all) change the URL to :

https://maps-api-ssl.google.com/maps/api/js?v=3.2&sensor=false

Remon’s picture

Status: Needs work » Needs review

bump

zzolo’s picture

Status: Needs review » Fixed

Should be fixed in 7.x-dev.
http://drupalcode.org/project/openlayers.git/commit/b6712d2

Going to make 2.10 the default soon.

zzolo’s picture

Oh, also, I made an option for the Google Layer type (in the API keys section) to use v3 of the Google Maps API.

Status: Fixed » Closed (fixed)

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

mikl’s picture

Status: Closed (fixed) » Patch (to be ported)

This should probably be merged for Drupal 6 as well.

mathieu’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new2.88 KB

Here's a first try at a backport to D6. Not sure about it though. Google refuses to provide me with a map if I don't provide a key. Maybe it's something about my site...

zzolo’s picture

Status: Needs review » Fixed

Thank you so much for the path. Committed:
http://drupalcode.org/project/openlayers.git/commit/855afa2

I did not run into any Google messages about API keys, so not sure.

Status: Fixed » Closed (fixed)

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

hvalentim’s picture

Does not work here.
Using 6 dev from 26 August with Openlayers 2.10 the map shows empty and an inspection gives:

TypeError  in js_fa74c715388bb6561f0e206b6c5259ed.jsmin.js:842

arguments: Array[2]
message: "—"
stack: "—"
type: "undefined_method"
__proto__: Error

jsmin.js has:

line 841: var openlayers=new OpenLayers.Map(map.id,options);Drupal.openlayers.addLayers(map,openlayers);$(this).data('openlayers',{'map':map,'openlayers':openlayers});Drupal.attachBehaviors(this);if($.browser.msie){Drupal.openlayers.redrawVectors();}}}
line 842: catch(e){if(typeof console!='undefined'){console.log(e);}
line 843: else{$(this).text('Error during map rendering: '+e);}}});}};Drupal.openlayers={'relatePath':function(path,basePath){if(path.indexOf('://')>=0||path.indexOf('/')==0){return path;}

Using OpenLayers 2.08 it works fine.

miguered’s picture

Hi all, looking for a way to display map routes using the google api, does anyone know how to? Im using openlayers and i would like to display my routes qith the google api, so i can have all the benefits of google maps like routing, how to get there, etc..

Is there any code/module to do this?

Im D7, OL 3.x.

Thanks very much.