1. Home
  2. Docs
  3. geoSherpa Documentation
  4. About geoSherpa for other HTML5

About geoSherpa for other HTML5

Adding geoSherpa to other HTML5 pages

geoSherpa is usable in most HTML5 web pages or applications. geoSherpa has been tested in:

To add geoSherpa to an HTML5 page:

1. Copy the following HTML snippet into the <HEAD> tag of your HTML page:

  <!-- geoSherpa Widget CSS Reference-->
  <link rel="stylesheet" href="https://cdn.geowidgets.io/geosherpa/lib/current/css/geosherpa-core.css">

2. Copy the following HTML snippet into the <body> tag, just before it closes (e.g. </body>):

  <!-- geoSherpa Widget JavaScript Reference -->
  <script type="text/javascript" src="https://cdn.geowidgets.io/geosherpa/lib/current/js/geosherpa-core.min.js"></script>
  <!-- geoSherpa initialization command -->
  <script>window.GeoSherpa.initialize({clientApiKey: "YOURAPIKEY", panelConfiguration: {visible: true,location: 1}});</script>
</body>

geoSherpa Initialization Parameters

Example

{
  clientApiKey: "f8ccb8ca-d77a-4887-bc3f-29c9eac6a524",
  cacheStateValues: true,
  panelConfiguration{
    visible: true,
    location: 1,
	verticalOffset: 0,
	horizontalOffset: 0,
  }
}

Reference

clientApiKey

Required
Type: String

This is the API key provided by geoSherpa Planner for a specific Guide. This can be obtained from geoSherpa Planner by selecting a Guide and Deploy Guide.

cacheStateValues

Optional
Type: Boolean
Default: true

This is an optional parameter that stores the current state and position of the geoSherpa widget in the user’s browser local storage. If you do not want geoSherpa storing data in user’s browsers (e.g. GDPR), please set to false.

panelConfiguration

visible

Optional
Type: Boolean
Default: true

Defines initial visibility of the geoSherpa widget on the page.

location

Optional
Type: Integer
Default: 1 (TopRight)

Defines the default position the geoSherpa Widget will open on the page.

0 = TopLeft
1 = TopRight
2 = BottomLeft
3 = BottomRight
4 = Center

horizontalOffset

Optional
Type: Integer
Default: 0

Defines the horizontal offset, in pixels, from the location parameter.

verticalOffset

Optional
Type: Integer
Default: 0

Defines the horizontal offset, in pixels, from the location parameter.

geoSherpa Code Examples

The following code examples illustrate how to use geoSherpa in various web pages and applications.