New Features – Linking to Maps Part 2

November 1, 2012 in Updates

The remainder of our linking code was completed much sooner than we anticipated, so this post outlines more options for linking to a customized À-la-carte map. All of our linking options are detailed at this page, which we will update as this functionality continues to expand.

You can now link to À-la-carte using feature names, Pleiades IDs, or through a json string, all of which are explained below.

Linking Through a Feature Name

Simply append the following to the url:

?name=somename

So, to link to a map with Athens already placed on it, your url would look like the following:

http://awmc.unc.edu/awmc/applications/alacarte/?name=athens

This parameter behaves exactly like the search function in the main application, so placing a partial name (i.e. pergam for Pergamum: http://awmc.unc.edu/awmc/applications/alacarte/?name=pergam) will return all places that have pergam in their name. Similarly, setting the parameter to Alexandria (http://awmc.unc.edu/awmc/applications/alacarte/?name=alexandria) will place all locations named Alexandria on the map.

 

Linking Through a Pleiades ID

Just like the name parameter, linking via a Pleiades ID is a simple matter. Just place the Pleiades ID after the ?pid=  parameter (you can obtain a Pleiades ID for a feature from À-la-carte, Pelagios, or directly from Pleiades). For example, the Pleiades ID for Athens is: 579885. The URL to link to an À-la-carte map of this id is:

http://awmc.unc.edu/awmc/applications/alacarte/?pid=579885

Note that, unlike the names parameter, the pid parameter will only return one feature. This is very useful if you only want to display a specific feature on the map.

 

Linking Through json

This option gives you the most control and flexibility when linking to À-la-carte, and is extremely useful for mapping existing projects.  Do not be intimidated by the format, as json is designed to be human readable and is easily modified. It is simply a formated list and is trivial to make from any source of names or Pleiades IDs.

You three main choices when sending json to À-la-carte:

  1. A list of names
  2. A list of Pleiades IDs
  3. “Raw” json directly from Pleiades

All of these options share the same parameter: jsonGet

 

Linking Through json: Names

For this, the json should look like the following:

{“names”:[{"name":somename], {“name”:”some other name”}]}

So, for a list of Alexandria, Athens, Rome, and Sparta the json is:

{“names”: [{"name": "Alexandria"}, {"name": "Athens"}, {"name": "Rome"}, {"name": "Sparta"}]}

Simply add

?jsonGet=

to the front of your json string and append this to the url, as in the following example:

http://awmc.unc.edu/awmc/applications/alacarte/?jsonGet={“names”: [{"name": "Alexandria"}, {"name": "Athens"}, {"name": "Rome"}, {"name": "Sparta"}]}

You will now see all of the places populated on the map. Once again, this behaves exactly like the search function on the map, so you may get multiple results for a single place name.

 

Linking Through json: Pleiades IDs

This functionality is nearly identical to the names discussed above, although it uses different keys in the json string.

The json should follow this format:

{“pids”: [{"pid": "somepid"}, {"pid": "some other pid"}]}

A potential pid list should look like the following:

{“pids”: [{"pid": "30205"}, {"pid": "876562"}, {"pid": "422995"}, {"pid": "550812"}]}

Simply add

?jsonGet=

to the front of your .son string and append this to the url, as in the following example:

http://awmc.unc.edu/awmc/applications/alacarte/?jsonGet={“pids”: [{"pid": "30205"}, {"pid": "876562"}, {"pid": "422995"}, {"pid": "550812"}]}

You will now see all of the places populated on the map.

Share

Leave a reply

You must be logged in to post a comment.