Hexagon Geospatial
MENU

API

M.App Portfolio provides a modern, cloud-based platform for creating and delivering diverse geospatial web applications.
Through the M.App Studio, our partners can design, build, and deploy their own Hexagon Smart M.Apps.
Showing results for 
Search instead for 
Do you mean 

M.App Studio Java Script API

by Technical Evangelist on ‎03-30-2016 06:24 AM - edited on ‎11-29-2017 06:46 AM by Benjamin.Schnitzer (2,985 Views)

Smart M.App API Reference (Link)

 

Getting started

 

Welcome to Smart M.App API Documentation. Here you can find all necessary information about customizing your Smart M.App.

 

Smart M.App Customizations

 

M.App Studio enables visual development of Smart M.Apps in a very simple three step process:

  1. Design the application layout.
  2. Build the application and populate the content.
  3. Customize the application for extended functionality.

 

The Smart M.App layout consists of one or more panels, which might be filled with such content types:

  • Map - to embed map view
  • BI Map - to embed map view with advanced Business Intelligence logic
  • Workflow Panel - to embed workflows into Smart M.App
  • Recipe Panel - to configure geoprocessing
  • Custom Panel - to implement custom functionality not provided by above mentioned content types.

 

The picture below shows an example Smart M.App application layout which consists of the following content types:

  • Custom Panel
  • Workflow
  • Recipe
  • BI Map

app_studio.png

 

For most common use cases, all the panels besides the custom panel can be configured visually during the Build step of the Smart M.App development process. However, in specific use-cases these panels might be customized (expect the workflow panel) to offer extended or modified behavior and/or display. The following customizations are available in the M.App Studio:

 

  • javascript customization
  • css style customization
  • html code customization (available only for custom panels)
  • linking external scripts.

 

The customizations are automatically saved with the Smart M.App configuration. You don't need to save it explicitly.

The API consists of several modules which are described in this reference.

During development of customizations you can use the public M.App Studio API available under the $GP namespace. Classes that are outside of the $GP namespace represent objects that are passed in callbacks invoked after calling certain $GP methods. Although they are part of the API, they are not meant to be instantiated by the client code.

 

 

Available APIs by functionality

 

While customizing panels you may use $GP API modules which can be grouped by functionality:

 

M.App Platform API: Manage items stored in your M.App Chest

  • $GP.m_app.platform.catalog
  • $GP.m_app.platform.publications
  • $GP.m_app.platform.shoebox

M.App Messages: Communication between panels

  • $GP.m_app.messsages

M.App Events: Events handlers

  • $GP.m_app.events

M.App Utils: Common modules

  • $GP.m_app.utils.connection

Map: Map Control API

  • $GP.crs
  • $GP.events
  • $GP.legend
  • $GP.map
  • $GP.queries
  • $GP.search
  • $GP.service
  • $GP.ui
  • $GP.utils

 

APIs availability by panel type

 

Below you can find which group $GP API module is supported in which panel

 

Module group Map & BI Map Custom Panel Recipe
Platform API X X X
Messages X X X
Utils X X X
Map X    
Events     X

 

Map controls API details

 

$GP API namespace Map BI Map
crs X X
events X X
legend X X
map X X
queries X X
search X X
service X X
ui X X
utils X X
Comments
by Chann
on ‎02-20-2019 11:16 PM

i am trying to get third party content based on area selected on the map(bbox) but this sample code provided on map studio is throwing this error: Potentially unhandled rejection [1280] TypeError: e.__rectangle.bringPathToFront is not a function

heres is the sample code

$GP.geometry.getBbox(
    true,
    function (bbox) {
        gsp.map.info(function (mapInfoResult) {
            gsp.crs.transform({
                sourceCrsId: mapInfoResult.info.crs,
                targetCrsId: "EPSG:4326",
                points: [
                    {x: bbox[0], y: bbox[1]},
                    {x: bbox[2], y: bbox[3]}
                ]
            }, function (result) {
                var discoverOptions = {
                    bbox: [result.points[0].y, result.points[0].x, result.points[1].y, result.points[1].x],
                    //"identifier": "",
                    maxAcquisitionDate: new Date(2016,6,1),
                    maxCloudCover: 10.0,
                    minAcquisitionDate: new Date(2016,0,1),
                    minCloudCover: 0.0,
                    products: ["Landsat-8"],
                    provider: "landsat",
                    sortBy: "acquisitionDate"
                };

                gsp.m_app.platform.content.discover(discoverOptions, function (searchResults) {
                   console.log(searchResults);
                });
            });
        });
    },
    function (err) {
        console.error(err);
    }
);