Topo Maps 2

View In

The default View In menu
The View In button lets you leave Topo Maps 2 to view an area in another map app.
By default, Apple Maps is enabled in regular and “satellite” (actually air imagery) modes.
View In settings
You can enable a few other popular maps in the View In section of the Settings screen.

Adding More Maps

You can add additional maps - either websites or apps - to this list, if you know the required technical details to do so.
For a website, you need to know how to construct a website address - a URL - that will open the map at a specified location. For an app, the app needs to have a “URL handler”, and again you’ll need to know how to construct a URL for it in the correct format.
You may be able to find the required details by searching the web, or by asking the people responsible for the website or app, or even by guessing.
Here’s an example: OpenRailwayMap. To determine its URL format, I zoom in somewhere - for example, Chicago - and tap on its “Permalink” button. My web browser’s address bar changes to show this:
https://www.openrailwaymap.org/?style=standard&lat=41.691373270757246&lon=-87.70797729492188&zoom=9
It is pretty clear that the latitude (41.6°) and longitude (-87.7°) of Chicago are embedded in there, along with a zoom value of 9. Specifically, the URL pattern - in the style that Topo Maps 2 wants it - is:
https://www.openrailwaymap.org/?style=standard&lat={lat}&lon={lon}&zoom={zoom}
I have simply replaced the numeric latitude, longitude and zoom values from the captured URL with the expressions {lat}, {lon} and {zoom}.
Now to tell Topo Maps 2 about this:
New Website / App Form
  1. Tap

    Settings

    to open the Settings screen, and scroll down to the “View In” section.
  2. Tap

    New App / Website

    .
  3. In the form that is presented, enter “OpenRailwayMap” as the name.
  4. In the URL Pattern box, enter https://www.openrailwaymap.org/?style=standard&lat={lat}&lon={lon}&zoom={zoom} (without any line breaks). Yes, it’s tedious on a phone keyboard. Maybe copy-and-paste from somewhere else?
  5. Tap

    CREATE

    and close the settings screen.
  6. If you now tap

    View In

    , the menu will contain a new entry for OpenRailwayMap. Tap this, and the website should open showing the same area that was visible in Topo Maps 2.
Menu with new entry

Syntax of Expressions

Expressions are contained between { and }.
Expressions can contain the variables listed below, numbers, and basic arithmetic operations. Most often the expression will just be a single variable, e.g. {lat}. The arithmetic operations are provided to support maps that require values such as half of one of these values, or 90° minus the value, and so on.

Available Variables.

The main variables are:
Additional variables are defined in 3D mode and can be used to link to 3D maps, i.e. Google Earth. In 3D mode the view is defined by an eye position in space, which looks towards a target position on the ground. lat and lon refer to the target position.
Arithmetic can use the operators +, -, *, / and mod, and can use parentheses ().
Please share any useful URL patterns that we could add to future versions of the app.
Note that View In settings are reset when the app starts in “safe mode“. You might like to save copies of your custom URL patterns so that you can recreate them if this happens.

Google Earth

It’s possible to link to Google Earth using this URL pattern:
https://earth.google.com/web/@{lat},{lon},{tgt_ele}a,{distance}d,{pitch+90}t,{(yaw+360) mod 360}h,{fov/2}y
https://earth.google.com/web/ may first open the online version of Google Earth, but should then offer to open in the app if you have it installed, and seems to remember this choice.

This App’s URL Handler

If you want to solve the opposite problem, i.e. to open this app from another one or a web page, then here is the information you need:
This app’s URL handler responds to URLS of the form https://topomapsapp.com/map?lat={lat}&lon={lon}&zoom={zoom}. Or alternatively, rather than giving lat and lon parameters, you can pass a single coords parameter that can contain any coordinate string that the app would understand if typed in, for example MGRS coordinates.
You can optionally add a mode parameter indicating which map mode the app should open in.
For example, here’s a link that should open the app at Central Park, NY, in Topo mode, if you tap it on a device where the app is installed:
https://topomapsapp.com/map?lat=40.77927&lon=-73.96840&zoom=15&mode=topo
Alternatively, you can use the custom URL scheme com.topomaps2: with the same parameters. Example: com.topomapsapp:lat=40.77927&lon=-73.96840&zoom=15&mode=topo.
The app doesn’t currently support opening in 3D mode. Let us know if you’d like us to make that possible.