IDigBio API v1 Examples: Difference between revisions

Line 1,097: Line 1,097:
=== Mapping Example ===
=== Mapping Example ===


The following HTML page with javascript code example is suitable for copying and pasting into a web site in order to display a small specimen map containing iDigBio data points.
The [[IDigBio API v1 Specification#Search|iDigBio Elasticsearch]] documentation should be considered required reading before attempting to integrate this code into one's site.


The [[IDigBio API v1 Specification#Search|iDigBio Elasticsearch]] documentation should be considered required reading before attempting to integrate this code into one's site.
This example displays a map that includes specimen data points that match the criteria of Scientific Name (dwc:scientificName) is "Abietinella abietina" and Institution Code (dwc:institutionCode) is "DUKE".


This example displays a map that includes specimen data points that match the criteria of Scientific Name (dwc:scientificName) is "Abietinella abietina" and Institution Code (dwc:institutionCode) is "DUKE".  The Elasticsearch terms for this query are:
The Elasticsearch terms for this query are:


<pre>
<pre>
Line 1,107: Line 1,107:
institutioncode": "duke"
institutioncode": "duke"
</pre>
</pre>
The following is a full HTML page with javascript code that displays a small specimen map containing iDigBio data points.


To customize the map search results, modify the <code>var terms = [ ... </code> section with the terms of your choice.
To customize the map search results, modify the <code>var terms = [ ... </code> section with the terms of your choice.
1,554

edits