# Publish a map at a link that keeps itself up to date

Make a map from a source that changes, publish it at a link anyone can open, and set a routine to refresh it every hour.

Video: Publish a map at a link that keeps itself up to date (1 min 20 s): /images/docs/videos/keep-a-published-map-current.mp4

## Best for

Anyone who sends people a map link and wants it to show the latest data, not the day it was made: a project map for partners, a status map for residents, a list of sites a colleague edits every week. You end up with one link that stays the same, and a routine that refreshes the data behind it on a schedule.

**The example in this guide** uses a live public feed: the US Geological Survey's list of earthquakes of magnitude 2.5 and over in the past week, a CSV at a fixed web address that USGS updates every few minutes. Each row is one earthquake, with its time, latitude and longitude, depth, magnitude, place name and status. No file was attached: Mapstack fetched the feed from its address. Every ask below was sent in that session. With your own data, the source is usually a spreadsheet in Google Drive, OneDrive or Dropbox, or a feed at a fixed address.

## What you need

- **A source that changes and that Mapstack can reach:** a file at a fixed web address, or a file in a connected Google Drive, OneDrive or Dropbox.
- **A Creator or Creator Max seat** on a workspace that pays for its seats, for the routine. Making and publishing the map works on any seat that makes maps.

## Before you start

- **Public means public.** A public map opens for anyone with the link, with no sign-in. Check what is in your columns first.
- **A routine runs at most once an hour.** For a map that changes faster, the hourly refresh is the closest it gets.

## The prompt

> Make a map of earthquakes of magnitude 2.5 and over from the USGS past-week feed (https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv), sized and coloured by magnitude, with the place, time and depth in the pop-up.

## What to expect

1. **Mapstack fetches the source and makes the map**

   Given the address of a file, Mapstack downloads it and makes a dataset: in the example, 318 earthquakes from the past week. The map is built from that dataset, styled as asked: here each earthquake is sized by magnitude and coloured in five classes from below 3.07 to 5.3 and above, with a legend, a search box and a table you can open. Selecting a point shows the fields you named.

2. **You publish it**

   Publishing is done on the map itself. When you ask, Mapstack tells you the steps:

   1. On the map, select **Publish**.
   2. Choose **Public**.
   3. Select **Make public**.
   4. Select **Copy link**.

   The link stays the same for as long as the map is public. Someone opening it sees the map with its legend and search, and a box for asking questions about it. To take it back, select **Publish** again and choose **Private (default)**. See [Make something public](/docs/share/make-it-public).

   ![Example: the published map as anyone with the link sees it: 318 earthquakes of magnitude 2.5 and over from the past week, sized and coloured by magnitude.](/images/docs/keep-a-published-map-current/earthquakes-public-map.jpeg)

3. **You set a routine to refresh it**

   A routine is a job Mapstack runs for you without a session. Ask, and Mapstack explains how to set one up and suggests the instructions:

   > I want this map to stay current without me re-uploading. Set it up to refresh from the feed every hour, and show when it was last updated.

   1. Select **Routines**, then **New routine**.
   2. Give it a **Name**.
   3. Under **Instructions**, say where the new data comes from and what to update, as you would brief a colleague. Name the dataset and the map, so the routine works on those.
   4. Under **When should it run?**, choose **Hourly**.
   5. Select **Create routine**.

   In the example the instructions were: *Download the latest CSV from the feed address and update the Global Earthquakes of Magnitude 2.5 and Over by Magnitude dataset, so the Earthquakes M2.5+ (Past 7 Days) map shows the latest week.* For a file in Google Drive, OneDrive or Dropbox, connect it under **Connectors** on the same form. See [Routines](/docs/automate/set-up-a-routine).

4. **You check that it works**

   Do not wait for the first hour. On the routine's page, select **Run now**. The run appears under **Runs**, and as a session in your Recents that shows the dataset and the map it updated. The routine's page also shows when it last ran and when it runs next.

   That is where the update time lives. The map itself has no "last updated" line: Mapstack offered instead to put the feed's own update time for each record in the pop-up and the table.

## Make it your own

> Publish it so anyone with the link can open it without signing in.

## Common questions

**Does the link change when the data refreshes?**

No. The link stays the same for as long as the map is public, and the map shows the data from the latest run.

**How often can it refresh?**

At most once an hour. When you need the latest data sooner, ask for it in a session.

**What if my source is a web page, not a file?**

Mapstack needs a file it can download, and some links lead to a page: an export form, or a table on a web page. Put the file in a connected Google Drive, OneDrive or Dropbox and point the routine at it. See [Bring in data from a link](/docs/find-data/data-mapstack-finds).

**Can the map show when it was last updated?**

Not as a line on the map. The routine's page shows when it last ran and when it runs next. Where the source records an update time for each record, Mapstack can put it in the pop-up and the table.

**How do I stop the refreshes?**

Pause the routine on its page, and switch it back to **Active** when you want them again. The map stays published with the data from its last run.

## Related

- [Make something public](https://mapstack.io/docs/share/make-it-public.md)
- [Set up a routine](https://mapstack.io/docs/automate/set-up-a-routine.md)
- [Choose when a routine runs](https://mapstack.io/docs/automate/when-a-routine-runs.md)
- [What a routine can and can't do](https://mapstack.io/docs/automate/what-a-routine-can-do.md)
- [Data Mapstack can find for you](https://mapstack.io/docs/find-data/data-mapstack-finds.md)
- [Use files from Google Drive, OneDrive or Dropbox](https://mapstack.io/docs/cloud-storage/google-drive-onedrive-dropbox.md)
