Custom Source Layers


in this lesson

Custom Sources are a way to bring in additional layers and overlays to CalTopo from outside sources. The ability to display additional geographic information in CalTopo is dependent on two initial factors:

  • The data must be hosted as a map server. This is what a map server page typically looks like, Snow Analysis
  • The data must be in one of three formats: Tile, TMS, or WMS.

Custom Source Layers require a Pro or higher subscription.

Topics on this Page:

Creating a Custom Source Layer

Let's start by taking a look at the edit box for adding a layer from a Custom Source.

add new layer menu showing custom source at the bottom

Custom Source is located at the bottom of the + Add Layer Menu.

In the edit box, there are three areas where you can input information: Name, URL Template, and Auto-Configure URL. If you have the URL of the Tile, TMS, or the WMS you can put it into the auto-configure box, and we will configure the API and populate the URL template with that information. You would use the URL template only if the API is already configured. The name is something you can choose that best describes the layer. More information on finding the URL to put into the auto-configure box and on choosing a label is provided below.

intial edit box for custom map source

Edit Box for a Custom Map Source.

Custom sources often have limitations in the ways they can display. For example, they do not zoom very well and work best at only a few zoom levels. Some will only display as an overlay and not as a layer, or they will work better as a layer rather than an overlay.

Saving To and Editing From Custom Layers in Your Account

Once you create a custom layer you can save the layer to your account, click Save to Account at the bottom left of the edit box, as described in the custom layers introduction lesson. Editing is also covered there.

Back to Top


Example 1: FEMA National Flood Hazard Layer

If you're already familiar with the formatting requirements, you can proceed to bring in a new data source. Here are two examples, including links to the data if you want to try them out yourself.

First, locate a link that either functions as a direct URL template matching one of the supported formats, or use a link that can be entered into the auto-configure box, allowing CalTopo to generate the correct format for you.

you need a link to enter into the auto-configure box, labeled here with an arrow pointing to it

Enter the URL into the auto-configure box.

In the U.S., we have access to FEMA's flood hazard layer, and the link for the source can be found here near the bottom of the page.

To locate similar data sources, try searching for your desired dataset along with terms like “web services,” “map server,” or “REST services.”

From the link above, we found:
https://hazards.fema.gov/arcgis/services/public/NFHLWMS/MapServer/WMSServer?request=GetCapabilities&service=WMS
near the bottom of the page.

a Map server webpage example

FEMA page that shows the custom source link you need

Paste the link into the auto-configure box and click “GO.”

A box will appear, allowing you to select which layers from the source should be included in your display. If you’re not familiar with FEMA National Flood Hazard Layers, you can visit this FEMA web map, zoom into your area of interest, click the layers icon, and expand the NFHL to see the list. Clicking on a list item displays a legend, which may be worth screenshotting.

three layer options are listed with checkboxes next to them

These are the options to choose from for the new custom source layer. Each contains different data, and you can select multiple layers.

three layer options are listed with checkboxes next to them

This list on the FEMA web map corresponds to the list in the dialog. Clicking an item shows a legend that may be useful to screenshot.

After selecting a layer—here, we choose NFHLWMS Flood Hazard Zones—click Save.

You may encounter an error message, which you can dismiss by clicking OK.

error box warning that the process may not work correctly

After clicking Go, a new link appears in the URL template box. Add a title for your layer and press Save to display it on your map.

in the custom source edit box, the field for URL template has an orange box around it to make it obvious

With everything filled in, click Save.

You now have a new layer, which works like other CalTopo layers—you can stack them, adjust opacity, etc. However, some layers—like NFHLWMS Flood Hazard Zones—may display a gray background that covers the base layer. When this happens, you’ll need to edit the URL created in the URL Template box. For example, the original URL is:

https://hazards.fema.gov:443/arcgis/services/public/NFHLWMS/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&BBOX={left},{bottom},{right},{top}&WIDTH={tilesize}&HEIGHT={tilesize}&BGCOLOR=0xCCCCCC&FORMAT=image/png&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&LAYERS=12

Edit it by adding TRANSPARENT=True so it becomes:

https://hazards.fema.gov:443/arcgis/services/public/NFHLWMS/MapServer/WMSServer?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&BBOX={left},{bottom},{right},{top}&WIDTH={tilesize}&HEIGHT={tilesize}&TRANSPARENT=True&BGCOLOR=0xCCCCCC&FORMAT=image/png&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&LAYERS=12

This particular data source works well in CalTopo as a layer because you can adjust opacity to view features like water bodies underneath. In some cases, it may be better to display the data as an overlay. If your custom source isn’t displaying as expected, consider changing it from a base layer to an overlay.

menu showing the custom layers, and the layer name with a pencil icon and a red x for delete icon listed along with the layer name.

Use the pencil icon to open the layer edit box.

custom source edit box open with the dropdown menu for overlay choices open. choices are no-base layer, or yes-transparent overlay

Edit the layer as needed, including switching between base layer and overlay.

While in the edit box, you can also rename the layer. If you like it and plan to use it again, save it to your account using the blue link at the bottom left.

After saving, refresh the page to see it in your layers list. To make further changes, create a new custom source and use the “Load From” feature at the bottom left of the edit box to select and edit your saved layer.

Accessing a Saved Layer

To edit a layer you've saved to your account, use the same custom source edit box. Open a new custom source layer and find the "Load From" dropdown menu in the bottom left.

You’ll see a list of layers saved to your account. Choose one and adjust the settings as needed.

Note – When you save a newly edited layer, it creates a new copy rather than replacing the original. If your intent was to update the original, go to the "Your Layers" section of your account info and delete the old version.

Back to Top


Example 2: British Columbia Aerial Image

Now let's try a different source.

Data source website in British Columbia, Canada.

Here is a website that provides access to public map data for the Province of British Columbia in Canada. Following the getCapabilities request link goes to the next page:

Data request page.

...which does not look like much. But we take the link listed as the URL here, and go back to CalTopo and pop it into the Auto-configure URL input.

Here we've pasted the URL into the Auto-Configure field.

Then press GO.

Next we get a long list of potential layers to pull into our new custom source layer. Depending on the map server, sometimes you will want all of the offerings, and sometimes only one. In this case, if we select all of them it’s very messy as these layers are not built to be tiled all into one. Let’s just pick one image - such as for Whistler.

Some map servers contain many layers - which sometimes fit all together, but in this case they do not, so we have only selected one layer. The only way to determine this is usually through trial and error.

Then I hit save and it goes back to the edit box.

After pressing the Auto-Configure GO button, the rest of the dialog box is filled.

The auto configure figured out that this was a WMS source and changed the Type field from Tile to WMS. It also created a URL template for me. I added a title called “Whistler Imagery.” Then select the save button to display the layer.

Now here is the imagery layer, and for compassion, the same location with the MapBuilder Topo layer.

The new custom layer is stacked over the original base layer, and opacity of the new layer is set to 100%.

So this image looks great when we are zoomed in quite a lot, but there is a problem as we zoom further out. Setting the custom source layer view at 100% opacity, and zooming out, we can see that this custom source is both geographically limited and the remaining background is all gray in places that the image does not cover. We could try going back and editing the layer to set it as a transparent overlay. However, in this case it remains the same. The gray background persists when set as an overlay, and furthermore we lose the ability to change the layer opacity. (If you are not familiar with layer opacity yet, check out the Using Base Layers lesson).

The image pulled from the source data is limited in its geographic extent. However, the areas where the image is not located are filled with gray, rather than being transparent. Changing the setting to make the layer an overlay does not fix the problem.

Here the custom source layer is displayed at 45% opacity.

One option is to view the layer at a lower opacity in order to see the context around it.

As you can see, custom sources can be fickle. Map servers are not necessarily serving up data that fits into CalTopo’s model of use. They require some digging, creativity, and trial-and-error.

Back To Top