Difference between revisions of "The Map URL API"

From University Map Wiki
Jump to navigationJump to search
(Imported)
 
(Subsititued M)
Line 1: Line 1:
Assuming the map is hosted at <strong>http://map.cam.ac.uk</strong>, which is abbreviated to <strong>M</strong> below, URLs have the following structure. Note that in all cases where a query string follows a directory the separating &#39;/&#39; is optional (i.e. <strong>M/x/?q=s</strong> is exactly the same as <strong>M/x?q=s</strong>).
+
URLs have the following structure. Note that in all cases where a query string follows a directory the separating &#39;/&#39; is optional (i.e. <strong>http://www.cam.ac.uk/x/?q=s</strong> is exactly the same as <strong>http://www.cam.ac.uk/x?q=s</strong>).
  
 
<table class="wikitable">
 
<table class="wikitable">
Line 12: Line 12:
 
<tr>
 
<tr>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
M or M/</td>
+
http://www.cam.ac.uk/</td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
displays the home page of the University map</td>
 
displays the home page of the University map</td>
Line 20: Line 20:
 
<tr>
 
<tr>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
M/<em>name</em></td>
+
http://www.cam.ac.uk/<em>name</em></td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
<p>
 
<p>
displays the map homed in on the item called <em>name</em>. <em>name</em> is URL encoded text for any entity the map can locate, ignoring case and punctuation and including any synonymous forms (such as Road vs. Rd). In fact this is simply an neater abbreviation for &#39;M/q=<em>name</em>&#39; (see below).</p>
+
displays the map homed in on the item called <em>name</em>. <em>name</em> is URL encoded text for any entity the map can locate, ignoring case and punctuation and including any synonymous forms (such as Road vs. Rd). In fact this is simply an neater abbreviation for &#39;http://www.cam.ac.uk/q=<em>name</em>&#39; (see below).</p>
 
<p>
 
<p>
 
<strong>If you want to link to a map on the centrally hosted site, this is the best kind of URL to use. </strong>But consider embedding a map: see below.</p>
 
<strong>If you want to link to a map on the centrally hosted site, this is the best kind of URL to use. </strong>But consider embedding a map: see below.</p>
Line 31: Line 31:
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
<p>
 
<p>
M/Lucy+Cavendish+College</p>
+
http://www.cam.ac.uk/Lucy+Cavendish+College</p>
 
<p>
 
<p>
M/austin%20building</p>
+
http://www.cam.ac.uk/austin%20building</p>
 
<p>
 
<p>
M/Fenner%27s</p>
+
http://www.cam.ac.uk/Fenner%27s</p>
 
<p>
 
<p>
M/Tennis+Court+Road</p>
+
http://www.cam.ac.uk/Tennis+Court+Road</p>
 
<p>
 
<p>
 
M:/fitzwilliam+st</p>
 
M:/fitzwilliam+st</p>
 
<p>
 
<p>
M/queens+college<br />
+
http://www.cam.ac.uk/queens+college<br />
 
(note the absence of apostrophe).</p>
 
(note the absence of apostrophe).</p>
 
</td>
 
</td>
Line 47: Line 47:
 
<tr>
 
<tr>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
M/?ref=<em>ref</em></td>
+
http://www.cam.ac.uk/?ref=<em>ref</em></td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
displays the map homed in on the item(s) referenced&nbsp;<em>ref</em>. References are geographical information and refer to entrances, buildings and sites/colleges as indicated by the ref=... tag on the corresponding OpenStreetMap data. <em>ref</em> can also be a list of references separated by &#39;|&#39;. Where buildings or sites are selected the corresponding main entrances are also displayed.</td>
 
displays the map homed in on the item(s) referenced&nbsp;<em>ref</em>. References are geographical information and refer to entrances, buildings and sites/colleges as indicated by the ref=... tag on the corresponding OpenStreetMap data. <em>ref</em> can also be a list of references separated by &#39;|&#39;. Where buildings or sites are selected the corresponding main entrances are also displayed.</td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
<p>
 
<p>
M/?ref=STEDMUNDS019<br />
+
http://www.cam.ac.uk/?ref=STEDMUNDS019<br />
 
(which is the Library building in St Edmund&#39;s College)</p>
 
(which is the Library building in St Edmund&#39;s College)</p>
 
<p>
 
<p>
M/?ref=WOLFSON--W<br />
+
http://www.cam.ac.uk/?ref=WOLFSON--W<br />
 
(Wolfson College W staircase)<br />
 
(Wolfson College W staircase)<br />
 
&nbsp;</p>
 
&nbsp;</p>
Line 62: Line 62:
 
<tr>
 
<tr>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
M/?inst=<em>inst</em></td>
+
http://www.cam.ac.uk/?inst=<em>inst</em></td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
displays the map homed in on institution(s) identified by&nbsp;<em>inst</em>,<em>&nbsp;</em>the institution code, which is case insensitive, or a list of these separated by &#39;|&#39;.</td>
 
displays the map homed in on institution(s) identified by&nbsp;<em>inst</em>,<em>&nbsp;</em>the institution code, which is case insensitive, or a list of these separated by &#39;|&#39;.</td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
<p>
 
<p>
M/?inst=CS<br />
+
http://www.cam.ac.uk/?inst=CS<br />
 
(computing service)</p>
 
(computing service)</p>
 
<p>
 
<p>
M/?inst=ucs<br />
+
http://www.cam.ac.uk/?inst=ucs<br />
 
(ditto)</p>
 
(ditto)</p>
 
<p>
 
<p>
M/?inst=lcc<br />
+
http://www.cam.ac.uk/?inst=lcc<br />
 
(Lucy Cavendish College)</p>
 
(Lucy Cavendish College)</p>
 
<p>
 
<p>
M/?inst=lucy-cav|joh<br />
+
http://www.cam.ac.uk/?inst=lucy-cav|joh<br />
 
(lucy Cavendish and St John&#39;s Colleges)</p>
 
(lucy Cavendish and St John&#39;s Colleges)</p>
 
</td>
 
</td>
Line 82: Line 82:
 
<tr>
 
<tr>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
M/?q=<em>search</em><br />
+
http://www.cam.ac.uk/?q=<em>search</em><br />
 
[&amp;one=list]<br />
 
[&amp;one=list]<br />
 
[&amp;partial<em>=</em>partial]<br />
 
[&amp;partial<em>=</em>partial]<br />
Line 100: Line 100:
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
<p>
 
<p>
M/?q=Lucy+Cavendish+College</p>
+
http://www.cam.ac.uk/?q=Lucy+Cavendish+College</p>
 
<p>
 
<p>
M/?q=lucy|queens</p>
+
http://www.cam.ac.uk/?q=lucy|queens</p>
 
<p>
 
<p>
M/?q=Wolfson+College&amp;one=list</p>
+
http://www.cam.ac.uk/?q=Wolfson+College&amp;one=list</p>
 
<p>
 
<p>
 
M?q=Do&amp;partial=yes<br />
 
M?q=Do&amp;partial=yes<br />
 
(which might yield results for Downing College, Downing Street, Downing Place, Downing Site and Doubletree by Hilton).</p>
 
(which might yield results for Downing College, Downing Street, Downing Place, Downing Site and Doubletree by Hilton).</p>
 
<p>
 
<p>
M/?q=Do<br />
+
http://www.cam.ac.uk/?q=Do<br />
 
(produces no results)</p>
 
(produces no results)</p>
 
<p>
 
<p>
M/?q=sussex&amp;filter=college</p>
+
http://www.cam.ac.uk/?q=sussex&amp;filter=college</p>
 
</td>
 
</td>
 
</tr>
 
</tr>
Line 118: Line 118:
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
 
<p>
 
<p>
M/?bb=<em>lat0,lon0,lat1,lon1</em><br />
+
http://www.cam.ac.uk/?bb=<em>lat0,lon0,lat1,lon1</em><br />
 
[&amp;z=<em>zoom</em>]<br />
 
[&amp;z=<em>zoom</em>]<br />
 
[&amp;one=list]<br />
 
[&amp;one=list]<br />
Line 130: Line 130:
 
</td>
 
</td>
 
<td style="vertical-align: top; ">
 
<td style="vertical-align: top; ">
M/?bb=52.2021,0.1184,52.2047,0.1218&amp;z=19</td>
+
http://www.cam.ac.uk/?bb=52.2021,0.1184,52.2047,0.1218&amp;z=19</td>
 
</tr>
 
</tr>
 
</table>
 
</table>

Revision as of 11:03, 27 June 2012

URLs have the following structure. Note that in all cases where a query string follows a directory the separating '/' is optional (i.e. http://www.cam.ac.uk/x/?q=s is exactly the same as http://www.cam.ac.uk/x?q=s).

URL Description Examples
http://www.cam.ac.uk/ displays the home page of the University map http://map.cam.ac.uk/
http://www.cam.ac.uk/name

displays the map homed in on the item called name. name is URL encoded text for any entity the map can locate, ignoring case and punctuation and including any synonymous forms (such as Road vs. Rd). In fact this is simply an neater abbreviation for 'http://www.cam.ac.uk/q=name' (see below).

If you want to link to a map on the centrally hosted site, this is the best kind of URL to use. But consider embedding a map: see below.

Older names will still respond to searches providing a cross reference is included in the database (as it was in the older system), or the old name is present in the 'AKA' field.

http://www.cam.ac.uk/Lucy+Cavendish+College

http://www.cam.ac.uk/austin%20building

http://www.cam.ac.uk/Fenner%27s

http://www.cam.ac.uk/Tennis+Court+Road

M:/fitzwilliam+st

http://www.cam.ac.uk/queens+college
(note the absence of apostrophe).

http://www.cam.ac.uk/?ref=ref displays the map homed in on the item(s) referenced ref. References are geographical information and refer to entrances, buildings and sites/colleges as indicated by the ref=... tag on the corresponding OpenStreetMap data. ref can also be a list of references separated by '|'. Where buildings or sites are selected the corresponding main entrances are also displayed.

http://www.cam.ac.uk/?ref=STEDMUNDS019
(which is the Library building in St Edmund's College)

http://www.cam.ac.uk/?ref=WOLFSON--W
(Wolfson College W staircase)
 

http://www.cam.ac.uk/?inst=inst displays the map homed in on institution(s) identified by inst, the institution code, which is case insensitive, or a list of these separated by '|'.

http://www.cam.ac.uk/?inst=CS
(computing service)

http://www.cam.ac.uk/?inst=ucs
(ditto)

http://www.cam.ac.uk/?inst=lcc
(Lucy Cavendish College)

http://www.cam.ac.uk/?inst=lucy-cav%7Cjoh
(lucy Cavendish and St John's Colleges)

http://www.cam.ac.uk/?q=search
[&one=list]
[&partial=partial]

[&filter=filter]

displays the map page with results of the search for the URL encoded string search. Multiple search strings may be given separated by '|'

'one=list' is optional and if given overrides the default behaviour (which is to display the single result) and instead to display it as a list of results comrpsing only a single entry.

If 'partial=partial' is given results returned by the search are interpreted as a partial search, that is in the same way as typing the first few letters of a word (the last word if more than one). If not present then a match is made only on whole words (including synonymous forms and ignoring case and punctuation, but in any order).

If filter is given, only results which match the filter are returned. filter is one or more of the following, separated by vertical bar, for example "filter=college|academic": college, academic, site, nonacademic, lecture, techno, street, nonuniversity.

Note that if the search yields only one result and the optional parameters are omitted, then the result is identical to the URL M:/name as above.

http://www.cam.ac.uk/?q=Lucy+Cavendish+College

http://www.cam.ac.uk/?q=lucy%7Cqueens

http://www.cam.ac.uk/?q=Wolfson+College&one=list

M?q=Do&partial=yes
(which might yield results for Downing College, Downing Street, Downing Place, Downing Site and Doubletree by Hilton).

http://www.cam.ac.uk/?q=Do
(produces no results)

http://www.cam.ac.uk/?q=sussex&filter=college

http://www.cam.ac.uk/?bb=lat0,lon0,lat1,lon1
[&z=zoom]
[&one=list]
[&filter=filter]

the equivalent of searching, except by bounding box rather than text string. Typically this is the URL derived by zooming in or out from an existing map. Content is filtered according to the zoom level, when provided, so that an overwhelming amount of information is not produced for low zoom. Note: no spaces after commas.

filter as above

http://www.cam.ac.uk/?bb=52.2021,0.1184,52.2047,0.1218&z=19