Select to view content in your preferred language

Panning and zooming a static map

2501
10
12-15-2022 09:09 AM
alex_p
by
Emerging Contributor

I'm trying to find a way to enable the map to remain in the same place (in world space) but have the ability to pan and zoom around it.

Imagine if the map was on a tabletop and the user could drag and pan around the map, but the map itself remained "stuck" to the tabletop (i.e remained in the same place.)

"Sea of Thieves" has the exact functionality of what I'm trying to do with the ArcGIS SDK.

I've set up a "local map" and tried moving the ArcGIS camera and the extents together (so they remain in sync) and whilst this allows me to pan the map and always see a cutout version (i.e. a rectangular table-sized map) essentially what is happening is the map is showing a rectangular masked version of the map at different points in world space.

alex_p_1-1671123345883.png

In the case of moving the ArcGIS camera and map extents at the same time, as previously mentioned for users standing around the map (each with their own camera) what they would see is the map move away from them. This is based on how ESRI use the map extents to mask off different parts of the "world map", as opposed to updating the tiles on a static quad.

From experimenting, I've found a couple of approaches, but all of them seem a bit convoluted and I'm hoping there is a much easier way for what seems like a pretty common use case.

First solution

Move the ArcGIS camera and map extents (as seen above) but use a render texture to render what the ArcGIS camera sees (in this case the map) to a static quad and have another static camera look at the quad. This works however, firstly it seems performance overkill to need to do this (have 2 cameras rendering) and also it won't work for terrain elevations (as the texture will obviously be flat.) So a none starter.

Second solution

Move the ArcGIS camera and map extents (as seen above) but move the ArcGIS map root transform relative to where the user is panning so it always appears in the same world space. I haven't implemented this yet, but it definitely feels like a better choice than the first solution.

Hopefully, someone out there has already come across this problem and could steer me in the right direction, as it feels like a pretty common use case.

Zooming

This is a bit tricky as the ArcGIS camera won't be rendering but instead, users will be viewing the map from their own perspective cameras.

We'll need to find a way to update the extents and scale of the map to effectively be able to zoom into or out of the map whilst it remains at a fixed world scale (i.e. appears like a fixed "table-top" map.)

Tags (3)
10 Replies
Thomas-F
Occasional Contributor

Hi @BereniceTe, I believe this would work for viewing a static 2D image of the map yes (see "First solution" section in OP), however you would then lose any 3D capability such as elevation / 3D scene layers.

Depending on what is important for your use-case this may be an acceptable solution though.