Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#176 closed enhancement (fixed)

Use google maps v3 API

Reported by: yvesm Owned by: adube
Priority: major Milestone: 1.2.0
Component: server Version: trunk
Keywords: bis-1.2.0 Cc:

Description

"The Google Maps Javascript API Version 2 has been officially deprecated as of May 19, 2010." (http://code.google.com/apis/maps/documentation/javascript/v2/)

We should include v3 in GP; see http://openlayers.org/dev/examples/google-v3.html

There are mentions that we do not need API keys anymore with v3, but I'm curious as to how we use a customer's existing API key.

Change History (15)

comment:1 by yvesm, 13 years ago

I came across this issue this morning because I saw http://openlayers.org/dev/examples/google.html in which there is a mention that

"For best performance, you must be using a version of the Google Maps API which is v2.93 or higher. In order to use this version of the API, it is best to simply set your application to use the string "v=2" in the request, rather than tying your application to an explicit version."

The API key we use on geoprisma.org returns

G_API_VERSION = "285c"

(http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAARMmL1tiEJKbdCyfzpyhY6BRqIMVObXAwFB1d0cAXbSApd5fpsxSbIaIz9W5CMmfY2i_j3AJto7mA7g)

so I understand we are currently using version 2.285c of the API, which is outdated even for the deprecated v2 API.

comment:2 by yvesm, 13 years ago

On a jusqu'au 19 mai 2013 pour faire le travail :

"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" (http://code.google.com/apis/maps/terms.html#section_4_4)

"The Google Maps Javascript API Version 2 has been officially deprecated as of May 19, 2010" (http://code.google.com/apis/maps/documentation/javascript/v2/)

comment:3 by adube, 13 years ago

The WMS services already use the 'version' option to choose the WMS version to use. We could do the same thing for the GYMO services and use that same option to set which version of the API to use. It would then be in to the Map and Layer widgets to read that option and create the according layer.

What do you think ?

comment:4 by yvesm, 13 years ago

Well, in the case of Google version 2 of the Maps API is deprecated, so there really is no choice there but make sure GP uses the right url to the new API and the new OL code (v3.js). See http://openlayers.org/blog/2010/07/10/google-maps-v3-for-openlayers/ for more info.

I wouldn't bother adding a new version tag for GYMO objects at this point. Just make sure GP points to version 3 of the GMaps API.

comment:5 by adube, 13 years ago

I agree. We could do both : change the default api to v3 for google layers and have a way to set the old one using the 'version' service option. That's a 'backward' incompatibility, but since we're talking of a deprecated feature, I wouldn't mind at all doing it that way.

comment:6 by yvesm, 13 years ago

For Google, using the old API (v2) is not an option : it is deprecated. For the config we would have :

<gymo>
<name>GoogleMaps</name>
<provider>google</provider>

<!-- Not sure about the apikey anymore; How do Google Premier licensees pass in their key ? -->
<apikey>
ABQIAAAARMmL1tiEJKbdCyfzpyhY6BRqIMVObXAwFB1d0cAXbSApd5fpsxSbIaIz9W5CMmfY2i_j3AJto7mA7g
</apikey>

<source>http://maps.google.com/maps/api/js?sensor=false</source>
</gymo>

and make sure we use the right OL code. Maybe a version option could be maintained for the other services (Yahoo, OSM, Bing) IIF there are version options for those services.

The only issue I'm not sure of at this point is how Google Premier licensees get to pass in their key to the new API. Technically, such licensees are allowed more operations/hits, etc. so there needs to be a way to pass in that information to the API. I've submitted a request to Google about that.

comment:7 by adube, 12 years ago

Milestone: 1.2.0

comment:8 by adube, 12 years ago

With the new printAllLibSources method calling printAllGYMOSources, I think this should be considered in 1.2 since GoogleMaps 2 is deprecated and should not be used anymore.

comment:9 by adube, 12 years ago

All samples should use GoogleMaps v3 API. Make the according changes.

comment:10 by adube, 12 years ago

Owner: set to adube

comment:11 by adube, 12 years ago

Version: trunk

comment:12 by adube, 12 years ago

We'll drop GoogleMaps v2 completely in 1.2. Make the according changes to the Layer and Map widgets.

comment:13 by adube, 12 years ago

Fixed in r1242 :

  • Layer and Map widgets now using v3 layer options
  • all samples using Google changed accordingly
  • note left in printAllLibSources

It would be nice to have a sample featuring the Google layers only.

comment:14 by adube, 12 years ago

Resolution: fixed
Status: newclosed

r1243, sample using GoogleMaps v3.5 added.

That concludes the work required by this ticket.

comment:15 by adube, 12 years ago

Keywords: bis-1.2.0 added
Note: See TracTickets for help on using tickets.