Google Street View Local Knowledge Type

Google Street View links can use the Google Street View Control in a Local Knowledge template. This allows an absolute location to be used and it can display the Street View in its dedicated control.

Example:

In map.aspx locate the following line:

<%-- <script async defer src="https://maps.googleapis.com/maps/api/js?key=<add your key here>&callback=initialise"></script>--%>

Change this line to:

<script async defer src="https://maps.googleapis.com/maps/api/js?key=<add your_api_key_here>&callback=initialise"></script>

There are two methods of adding Street View code, both methods require SQLite (run as Administrator) or similar:

<div><b>Google Street View</b></div><div><div id="{uniqueID}" style="width:100%; height:300px"></div><script>createGoogleMap({searchLocation.x},{searchLocation.y}, '{uniqueID}');<\/script><p></div>

In this case you are adding the code to an existing template used for another query, the overlay used for that query is then used to determine the search area.

<div><b>Google Street View</b></div><div><div id="{uniqueID}" style="width:100%; height:300px"></div><script>createGoogleMap({searchLocation.x},{searchLocation.y}, '{uniqueID}');<\/script><p></div>

In the LocalKnowledgeUK swd, add an overlay with a polygon containing the searchable area, i.e. create a polygon all around UK, call this overlay area:

Add the following property to the area overlay:

WML::Knowledge_Type$='area'

When the above entries are complete start Web Map Layers 8.0.

You may need to restart IIS for the settings to take effect.

In this example the Local Knowledge display will be similar to:

Google Street View can be set to appear in the middle of the Local Knowledge dialog (as shown above) or at the top or bottom of the dialog.

To set Google Street View at the top use the AMP property and place the SWD overlay at the top of the list.

To set Google Street View at the bottom use the FMN property and place the SWD overlay at the bottom of the list.

For Street View to appear on mobile devices, ensure you make these changes in Mobile\map.aspx as well.


Send comments on this topic.