JMap Cloud
English
English
  • Welcome to JMap Cloud documentation
  • JMap Cloud Portal
    • JMap Cloud Portal User Guide
      • Introduction
        • Accessing JMap Cloud Portal
        • User Interface
        • Dashboard
        • Roles
      • Managing the Organization
        • General
        • API Keys
        • Extensions
        • Members
        • Groups
        • Invitations
      • Connecting Data: Data Sources
        • Creating Data Sources
          • Vector/Raster Data Files
          • Non Spatial Tabular Data Files
          • WMS/WMTS Service
          • Vector Tile Service
          • Feature Service
        • Status of a Data Source
        • Managing Data Sources
          • Displaying and editing information
          • Updating data
          • Permissions
          • Removing a data source
        • Uploading Files
      • Organizing Data into Projects
        • Creating a New Project
        • Managing Projects
          • Open in JMap NG
          • Open in Studio
          • Settings
          • Permissions
          • Get the Public Link
          • Vector Tile Cache
          • Deleting the project
      • Configuring Project Data
        • Setting the Initial Extent
        • Adding Data
        • Organizing Layers
          • Setting the Order of the Map Layers
          • Establishing the Order of Layers in the Layers Panel of Studio and JMap NG
          • Focusing the Map on a Layer
          • Resetting Display
          • Adding a Layer Group
          • Deleting a Layer or Layer Group
          • Controlling the Display of a Layer or Group of Layers
        • Configuring a Layer
          • Layer Properties
          • Styles
          • Labels
          • Popups
          • Layer Filters
        • Configuring a Data Table
      • Jobs
  • JMap NG
    • JMap NG User Guide
      • Introduction
        • Connecting to JMap NG
        • User Interface
        • Navigating on the Map
        • Profile and user settings
      • The Data
        • The Layers Panel
        • Data Layers
          • Displaying layers
          • Thematics
          • Layer Information
          • Geographic Extent of the Layer
          • Making layer elements selectable
      • I Wish to...
        • Display Element Information
        • Select Elements on the Map
        • Measure Distances and Surfaces
        • Add Annotations to the Map
        • Export / Print a Map
    • JMap NG Developer Documentation
      • Startup Options
      • Extensions
      • Examples
        • Start the JMap NG Core library
        • Start the JMap NG App
        • Add a JMap NG App extension
        • Toggle a JMap layer visibility
        • Add a layer to display custom data from GeoJSON file
        • Locate and select features by attribute query
        • Add an event on move end
        • Add attributions on the map
        • Locate and select feature by id
        • Locate and select feature(s) by location
        • Custom mouseover on a layer
        • Create a custom form in a div
      • Changelog
  • JMap Cloud API
    • JMap Cloud API Documentation
  • JMap Cloud Plugin for QGIS
    • JMap Cloud Plugin User Guide
      • Installing the plugin
      • Connecting to JMap Cloud
      • Opening a project
      • Editing features
      • Exporting a project
Propulsé par GitBook

K2 Geospatial 2023

Sur cette page
Exporter en PDF
  1. JMap NG
  2. JMap NG Developer Documentation

Extensions

PrécédentStartup OptionsSuivantExamples

Dernière mise à jour il y a 4 mois

Extensions are plug-ins for JMap NG App that extend its functionalities. With the JMap NG API, you can develop your own extensions.

Extensions can add their own UI, typically an icon and a side panel. It is possible to have extensions with a different UI and even with no UI at all.

NG Extensions are javascript objects that respect an interface (either or ) and that are loaded by NG at application startup or project load, depending on the type of the extension. Every extension must have a unique id property, a initFn implementation, if implementing , and a onPanelCreation implementation if implementing .

Extension life cycle

Extensions are being "registered" by NG in 2 different ways:

The registering process most importantly includes incorporating your extension's redux reducers, if provided, your translation bundle, if provided, and the extension service to expose, if provided.

When NG registers your extension, it automatically calls your extension's initFn and onPanelCreation methods. In your initFn or onPanelCreation method, you can handle all your extension's initializing process. Once the initFn method is called, you can start calling NG's API to communicate with it.

Extension unique ID

The Extension Unique ID serves a dual purpose for NG: it used by NG to identifiy and manage the loading process of extensions, while also establishing a connection with a server-side extension. This connection can link your extension to specific JMap projects, optionally allowing for the transmission of configuration data to your extension during project loading. The nature of your unique id thus depends on your way of deploying it.

How to deploy your extension

Once your extension is ready to deploy, you can compile it and host it on any CDN of your choice. If your extension is loaded via a project, the URL of your CDN will be configured in the server-side part of your extension. If you include your extension as a <script> tag in an HTML page, you will be able to use the CDN's url. In all cases, this url should always be accessible from the location where NG will run.

if included in the JMap NG , they will be automatically registered by NG.

If loaded from a javascript <script> tag or via a project load, the extension must register itself. This is typically done in the extension "entry point" by calling the method, for a Core extension, or method, for an Application extension.

You can see a full extension example .

startup options
JMap.Extension.register
JMap.Application.Extension.register
here
JCoreExtension
JAppExtension
JCoreExtension
JAppExtension