Google Street View integration
Hi all,
I would like to add a Google Street View button to my Viewer.
I am using GVH 2.8.2 Essentials 4.7.1.42
I have been following this documentation:
https://support.geocortex.com/essentialsGSCCodeGallery?sub-nav=codegall&main-nav=essentials&#!/feedtype=SINGLE_ARTICLE_DETAIL&criteria=BESTANSWERS&id=kA460000000blX2CAI
I have created a Google Street View Image API, and it is currently activated with no URL restrictions.
I have modified the GoogleMaps.html file located here C:\inetpub\wwwroot\Html5Viewer\Resources\3rdPartyMaps\ to contain the API reference number as the following
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=yourAPIKeyGoesHere"></script>
I have seen in other bits of code in the google maps API documentation that look more along the line of
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initialize"></script>
I have also updated the following js: C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\[instance]\REST Elements\Sites\[site]\Viewers\[viewer]\VirtualDirectory\Resources\Config\Default\Desktop.json.js
with
"externalComponents": [
{
"id": "googleMaps",
"displayName": "Google Street View",
"uri": "Resources/3rdPartyMaps/GoogleMaps.html",
"viewpointIndicatorUri": "Resources/Images/Icons/location-direction-blue-32.png"
}
]
The result I am getting is that Street View widget displays in the toolbar once I have added it. When I launch my viewer I can get the street view window to pop up and display a street view image for a quick moment. Then I get an error: "Oops! Something went wrong"
in the javascript console I see the following:
Google Maps API error: ApiNotActivatedMapError https://developers.google.com/maps/documentation/javascript/error-messages#api-not-activated-map-error
_.Ub @ js?v=3.exp&key=MY_API_KEY_IS_HERE:40
(anonymous) @ common.js:50
(anonymous) @ common.js:192
c @ common.js:44
(anonymous) @ AuthenticationService.Authenticate?1shttps%3A%2F%2Fdevgis.whistler.ca%2FHTML5viewer%2FResources%2F3rdPartyMaps%2FGoogleMaps.html&4sAIzaSyCVq5A_CXHLuVL12rwlmar4spdSrZo4oD8&callback=_xdc_._bt04kl&token=4966:1
However, I have my API activated, and open to all URLs. I have ensured that it is properly entered in the GoogleMaps.html
Any suggestions?
Thanks!
0
-
Always great to answer my own question.
It turns out that you must activate Google Maps JavaScript API and not Google Street View Image API. This is to activate Google Street View. Confusing? Maybe. But it works!
My mistake,
Thanks!0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
1 kommentar