Embed

The Planviewer Maps API enables the creation of viewers and the subsequent embedding of said viewers into your own website. There are three entry points: an Editor, which enables editing and uploading of features on specific layers; a Dossier editor which allows setting a dossier area outline; and the end result Viewer embed which is a read-only view into the viewer you created.

Interaction between the Editor, Dossier editor or Viewer embed and your website is not possible. Please consult the Server Calls documentation for possible interactions between Planviewer Maps API and your website.

Viewer

A read-only view of the viewer identified with (identifier). At the creation of the viewer, either via a Server Call or via the Admin Panel, these features can be enabled:

Print
Enables the printing of the viewer to PDF.
Reset
Resets the viewport to the original view.
Measure
By clicking on the viewer both the length of a series of lines and the surface of a polygon are computed.

These features are disclosed to the user via a toolbar on top of the Viewer embed.

Note

To prevent long loading times on complex viewers all layers are loaded but not visible on default

Warning

The Viewer embed is publicly accessible if the URL is known and OAuth is not enabled.

../_images/viewer.png

Create an iframe with the following request:

GET https://www.planviewer.nl/maps_api/v2/embed/viewer/(string: identifier)
Query Parameters:
 
  • active_layers (boolean) – Opens the layers panel immediately when true. This optional query parameter defaults to false.
Status Codes:
  • 404 Not Foundidentifier does not refer to a viewer.
  • 403 Forbidden – OAuth is set, but the browser has not (yet) been correctly authenticated.
  • 200 OK – OAuth is not set, or the browser has been correctly authenticated.

Example HTML:


Optional variables

The viewer supports several optional variables to help you customize the viewer presentation.

Layers visible on load

extend the embed URL with the variable visible_layers=1 or visible_layers=true to display the layers on load.

<iframe src="https://www.planviewer.nl/maps_api/v2/embed/viewer/5f2a5e10c39b70576c70e7d58b7c1c8ca482369d58bf2f2c989e001c0a18f03b?visible_layers=true"></iframe>
Show layer index on load

The layer index (kaartlagen) is not open on load. Extend the embed URL with the variable active_layers=1 or active_layers=true to have it open as default.

<iframe src="https://www.planviewer.nl/maps_api/v2/embed/viewer/5f2a5e10c39b70576c70e7d58b7c1c8ca482369d58bf2f2c989e001c0a18f03b?active_layers=true"></iframe>

Editor

The editor is only available for layers of the vector type for which the drawable property (Bewerken data via editor toestaan) is set to true. Using the editor you can draw geometries and upload new shapefiles to replace the existing data via a toolbar on top.

../_images/vector_editor.png

Note

The Editor only is accessible for visitors if OAuth is enabled. Otherwise use the Maps API dashboard on your profile pages to access the Editor.

GET https://www.planviewer.nl/maps_api/v2/embed/editor/(string: identifier)/(int: layer)
Status Codes:
  • 404 Not Foundidentifier does not refer to a viewer.
  • 403 Forbidden – OAuth has not been set, or the browser has not (yet) been correctly authenticated.
  • 200 OK – The browser has been correctly authenticated.
<iframe src="https://www.planviewer.nl/maps_api/v2/embed/editor/5f2a5e10c39b70576c70e7d58b7c1c8ca482369d58bf2f2c989e001c0a18f03b/207"></iframe>

Dossier editor

The dossier editor is used to set an initial view and dossier outline for your viewer. Users will only see data within the dossier outline region.

Note

The Dossier editor only is accessible for visitors if OAuth is enabled. Otherwise use the Maps API dashboard on your profile pages to access the Dossier editor for your viewer.

GET https://www.planviewer.nl/maps_api/v2/embed/dossier/(string: identifier)
Status Codes:
  • 404 Not Foundidentifier does not refer to a viewer.
  • 403 Forbidden – OAuth is set, but the browser has not (yet) been correctly authenticated.
  • 200 OK – The browser has been correctly authenticated.