VMware Cloud Community
CianoKuraz
Enthusiast
Enthusiast

Google MAPS API v2 deprecated and not working anymore .. how can i use the V3

Hi

it seems that vcops uses the V2 version of Google MAPS API, but they are deprecated and no key can be generated for the V2..

Is there a way to tell vcops to use the V3 version?

Alan Civita - RHCA - vCAP-DCD, vExpert2014
0 Kudos
8 Replies
CianoKuraz
Enthusiast
Enthusiast

the code on this 2 file should be changed:

under the directory /usr/lib/vmware-vcops/tomcat-enterprise/webapps/vcops-custom/pages

widgetGeo.jsp

pickerGeoLocation.jsp

the lines:

<s:if test="%{googleMapKey != ''}">

            <script src="https://maps.google.com/maps?file=api&v=2&key=${googleMapKey}" type="text/javascript"></script>

         </s:if>

shoud be:

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=API_KEY&language=de"></script>

as described in

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

but it's not enough Smiley Happy..

Alan Civita - RHCA - vCAP-DCD, vExpert2014
0 Kudos
cleitenb
Contributor
Contributor

what do you mean: but that's not enough?

BTW: are you sure to replace the lines "<s:if ..." and </s:if)?

Thanx in advance

Christian

0 Kudos
CianoKuraz
Enthusiast
Enthusiast

Hi

i mean that it doesn't work Smiley Happy

i've found another file to modify in the same directory ..and  is the environmentOverview.jsp file.

Now the situation is that i don't get the API V2 error anymore, but the Google Map CHart is blank!

yes sure only line to be modified is the <script   one

this is the replace string:

<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=${googleMapKey}"></script>

UPDATE:

well there are a lot of things to change..that only the developers can do...

you need to change your code to make use of the new namespace

for example Gmap2 now is google.map.Map

Alan Civita - RHCA - vCAP-DCD, vExpert2014
0 Kudos
cleitenb
Contributor
Contributor

Ok, error messages disapears and "Manage location" button in the Manage Resource Tag Window is now there, but no maps, just whitespace Smiley Sad

I'll dig deeper....

0 Kudos
CianoKuraz
Enthusiast
Enthusiast

i think that all the Geo module should be rewritten using the new V3 functions

take a look here

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

btw i have just opened an SR to the support

Alan Civita - RHCA - vCAP-DCD, vExpert2014
0 Kudos
gradinka
VMware Employee
VMware Employee

0 Kudos
CianoKuraz
Enthusiast
Enthusiast

Ok,

nice sounds good!

Thank you

Alan Civita - RHCA - vCAP-DCD, vExpert2014
0 Kudos
cleitenb
Contributor
Contributor

Hope this will work in v5.8 of vCOPs ;o)

Thank you for the information

0 Kudos