How can I customize the map provider

Q&A about the latest versions
Post Reply
462467411@qq.com
Posts: 6
Joined: Mon Jan 25, 2021 3:35 pm

Hello, I am a user from China, and Google Maps cannot be used when using Roaming Maps. How can I customize the map provider, such as using Baidu map or Gaode map.Many thanks!
BParker
Posts: 78
Joined: Mon Jan 07, 2013 10:08 am
Location: Redlands, CA
Contact:

As you probably already know, Pano2VR provides built-in support for Google Maps, OpenStreetMap, and Mapbox. There is also a custom interface for supporting URL-based tiled map images. If none of these work for you, there is another approach that might provide a basic map-viewing capability. If your map provider allows you to generate an interactive map using a URL that takes the target location as a parameter, it may be possible to embed that URL in an html iframe and display it using a Pano2VR text box.

In the following panorama, three map formats are provided: streets, terrain, and imagery (aka satellite). The first two formats use Pano2VR’s OpenStreetMap support but the last one uses an iframe in a text box to provide satellite imagery from Esri’s ArcGIS Online mapping service:

https://lookabout.net/hikes/blue_mounta ... ntain.html

Here’s the html code used in the text box:

<iframe width="$(*varImagerySize)" height="$(*varImagerySize) frameborder="0" scrolling="no" src="https:{esri web app url goes here}&marker=$(lng),$(lat),,Location of the current panorama,,&zoom=18"></iframe>

The Pano2VR placeholders for the current panorama’s latitude and longitude were incorporated into the html code to position the imagery and add the map marker symbol. Two user-defined Pano2VR variables control the dimensions of the map. The text box was sized to match the OpenStreetMap skin element and buttons were added to coordinate their visibility.

Admittedly, the user interface for the satellite imagery is not as nice as Pano2VR’s built-in map support, but a basic viewing capability is achieved. In terms of limitations, only the current panorama is marked on the imagery maps, so the ability to jump to a new panorama with a map click is lost. Also, the current extent of the OpenStreetMap views and the Esri imagery views are not synchronized.

If Baidu or Gaode allow you to generate maps using a URL that specifies a target location and a map extent (a zoom factor) and you aren’t able to find any better approaches, maybe this technique could work for you.
Post Reply