ArcGIS Widget (DEPRECATED)

Category: Widgets
Subcategory: Utility

Overview

Connect your Mendix app to ArcGIS for a high quality GIS experience in Mendix

As of 6th of April 2022 there is also a newer version of the ArcGIS widget, ArcGIS Widget 2.0, available, based on React, the Pluggable widgets API and the newest (02-2022) ArcGIS API. 

ArcGIS Widget 2.0

ArcGIS Demo Project (React)

 

 

 

Documentation

Demo urlhttps://arcgis100.mxapps.io/index.html?profile=desktop

Description

Connect your Mendix app to ArcGIS for a high quality GIS experience in Mendix.

Please check out the 'ArcGIS - Demo Project' available in the AppStore for more easy configuration!

Typical usage scenario

When your customer has ArcGIS for maintaining it's assets

Features

  • Loosely connect ArcGIS and Mendix database with single ArcGIS ObjectID in Mendix;
  • Plot both Map Server and Feature Server Layers;
  • Toggling Layer visibility;
  • Show all objects in Layer or only restrict to objects in Mendix
    • XPath;
    • DataSource;
    • ListenToGrid;
  • Fully customize InfoWindow;
    • On Click Microflow to trigger Mendix logic from infowindow;
  • Customize marker by changing symbol and color;
  • Legend;
    • Set a label in the legend per Color
  • Search widget with autocomplete to easily zoom to certain address;
  • Custom styling settings to incorporate company specific coloring;

Limitations (not included)

  • Drawing / Editing of Layers (Polygons, Polylines, Points..)
  • Authentication

Supported scenarios 

  • Listen-to-grid;
  • XPath;
  • DataSource Microflow;

Dependencies

  • Mendix 6 (will not work in Mendix 7 yet, due to dojo conflicts)
  • The ArcGIS API also makes use of the dojo framework

Installation

Add the ArcGIS widget to your Mendix page and start configuring. 

Configuration

1. DataSource

•    Object Entity

Select the entity which is used to store the ArcGIS (Object) ID in. The objects will be the Mendix extension of the ArcGIS Geo Objects that are plotted onto the ArcGIS map. Keep in mind, in Mendix, technically, no geodata (coordinates) have to be stored. Those will be retrieved from ArcGIS via REST calls within the widget itself.

•    XPath Constraint

Add an XPath constraint if you want to only show the objects in the layer that agree with the contraint.

•    Object ID

The attribute of the Object Entity holding the ArcGIS ObjectID. This ID will be used to properly query ArcGIS for showing the correct objects and for zooming to the correct object in a listen-to-grid scenario.

•    ArcGIS Identifier Name

Here state the actual name of the ArcGIS unique identifier. Typically this is ObjectID, but can also be ID. This needs to be checked on the ArcGIS server.

•    Center Coordinates

In the listen-to-grid scenario, this attribute will be used to store the coordinates of the ArcGIS object in. The next time a user wants to zoom to the object by clicking on the object in the datagrid, the coordinates do not have to be retrieved anymore via a query to ArcGIS. Better for performance, but can be left empty.

•    Color Attribute

When you want to overrule the coloring of the objects in the layer which has QueryLayer set to ‘Yes’. Input should be given in RGB color format. Red should be entered like 255,0,0 In the Layer pane, section Color Labeling, one can format the Legend entries based on those colors.

•    Geometry Type

When drawing / editing multiple different types of objects (polygon / polyline / point) in a single widget instance it is needed to store the geometry type from the ArcGIS object in the Mendix database. For this, add an extra attribute to the Object Entity, holding EXACTLY the following Enumeration: point, polygon, polyline, multipoint

•    Get Objects Microflow

Can not be used when adding an XPath Constraint. Retrieve the Object Entities from a DataSource Microflow. When selecting this, also select the next setting, the ‘Get Objects Entity’.

•    Get Objects EntitySpecify the DataView entity which will be used as an inputparameter for the microflow to retrieve the correct Object Entity instances with.

2. Behavior

•    Base Default Map URL

Add the URL to the base map on which all layers will be added. Default is “topo_nl” / https://services.arcgisonline.nl/arcgis/rest/services/Basiskaarten/Topo/MapServer

•    Base Satellite Map URL

Add the URL for ‘the other map’, which will be shown when clicking the toggle button. Default is https://services.arcgisonline.nl/arcgis/rest/services/Luchtfoto/Luchtfoto/MapServer

•    Spatial Reference

Add the ID of the spatial reference or coordinates system

•    Default Y

Add the default latitude / y coordinate for the map to start at once shown. Will only be applied if no Mendix objects are found by either of the three sources mentioned.

•    Default X

Add the default longitude / x coordinate for the map to start at once shown. Will only be applied if no Mendix objects are found by either of the three sources mentioned.

•    Default Zoom Level

Detemines the initial zoom level once the map is shown

•    Object Zoom Level

Detemines the zoom level for showing a single object on the map. The higher the integer, the closer it zooms in. Be aware that in ArcGIS it can be configured at what zoom level a user will see specific features. So, it could very well be that this setting will differ per implementation.

3. Appearance

•    Show All Objects

If a layer consists of more objects than those that are stored in Mendix and retrieved via one of the three sources (XPath, DataSource, ListenToGrid), set this to ‘Yes’ to show all objects / features in the layer.

•    Enable Legend

This boolean will either make the legend appear or not; 

•    Enable Toggling Layers    

This boolean will make a menu appear in the accordeon in which the user can tick/untick layers. This will make all objects from that Layer or SubLayer (dis)appear.

•    Enable Search

Add a custom search widget to the left top corner of the ArcGIS map. •    Start SublayerList CollapsedDecide whether the Toggle Menu starts collapsed or expanded on entering the page.

•    Height

Add here the height in pixels for the div holding the ArcGIS map;

•    Width

Add here the width in pixels for the div holding the ArcGIS map;

•    Custom Color

Add the color of the border of the map. Both simple notation (blue, red, green) as well as hexadecimal (#ff0000) are supported. This color will also be used for the on hover color change of the accordion menu items.

•    Selected Color

This color will be used to style the active pane of the accordeon menu.

4. Layer

In this tab pane a user can add multiple Layers. Two types of layers are supported; Feature and Map Server layers. Depending on the choice for either of them, other settings are available. 

Keep in mind; for Feature Layers only one sub layer can be configured as Layer Definition Item, for Map Layer multiple sub layers can be configured as one Layer Definition Item.

Layer Definitions

•    Layer Server Type

State which type of server will be used to load the layer. Either Feature or Map Layer. A Feature Layer is typically used to interact with, so the Layer you want to interact with should typically be a Feature layer. All other layers should just be shown, hence can use Map Server type.

•    Layer URL

Add the URL of the layer. This is the part after /arcgis/rest/services/

•    Layer Name

The name of the Layer to appear in the Toggle Layers pane.

•    Visible Layer Indices

(Map Server only) Add the sub layers of the layer that need to be shown. Typically these are integers. If multiple need to be shown, add a comma separator in between. Again, for implementation, see the ‘ArcGIS Widget – Demo Project’.

•    Start Layer Ticked

If set to ‘Yes’ the map will be shown with this layer unticked in the legend, hence unvisible on the map initially.

•    Feature Layer ID

(Feature Layer only) The equivalent of Visible Layer Indices for the Feature Layer. Can only hold 1 sub layer index!

•    Query Layer

(Feature Layer only) Typically only 1 Feature Layer should be set to ‘Yes’. This Layer will be used to retrieve the ArcGIS objects the user wants to interact with, from.

•    Show Attribution

Whether the attribution of the layer (which company attributed to the map) should be shown in the lower right corner of the map:             

•    Layer Opacity

(Feature Layer only) Adjust the opacity of the objects shown on the map. 1.0 means fully opaque, 0.0 means fully transparent. For polygons typically use 0.5.

•    Layer Geometry Type

When multiple interactable layers are added to the map, add this setting to let the widget ‘know’ which layer has which type of geometry. If the scenario is that Points, Polylines and Polygons can be drawn and interacted with, the widget needs to know which Layer has which type of geometry. The reason behind this is that Mendix queries the ArcGIS database based on the ObjectID of that object. If multiple interactive layers exits, it could very well be that the ObjectID alone is not unique anymore, but the combination of Geometry Type and ObjectID is. 

Note: If multiple Layers of the same Geometry Type exist, a user wants to be able to draw on all layers, and the ObjectID’s of those different Layers overlap, the widget will not work correctly, since it does not know which Layer to query for the ObjectID.

Color Labeling

Here one can configure the labels that will appear for each object having a specific color set by the Color Attribute of the ArcGIS Object. This is only appplicable fort he Feature Layer which is the Query Layer. This can only be one layer, see Layer Definition!

•    Feature Color

Select the RGB color the ArcGIS object can have.

•    Feature Label

Specifiy the label to appear in the Legend for this specific color.

Other Layer Settings

•    Marker Symbol

Here one can choose from 5 types of default marker symbols to be displayed on the map. This setting will override the symbol coming from ArcGIS for the layer which is marked as Query Layer.

•    Default Color

For all objects in the ArcGIS layer, not in Mendix, this color will be used.

•    Default Label

For all objects in the ArcGIS layer, not in Mendix, this label will be displayed in the legend.

5. Interaction

In this tab pane a user can define how the user interacts with the widget.

Attributes

Here multiple attributes (which of course should be available in ArcGIS) can be added to be shown in an infowindow popup. To understand which attributes are available in the specific ArcGIS layer, check the relevant ArcGIS API for that layer.       

•    The Name field should hold the name as is stated in the service;

•    the Label  field is a free field you can customize which will be used as the caption in the popup;

•    the Is Title boolean should be used for only one attribute and -if set- will use this attribute + label for the title of the pop-up;

Other Settings

 •    On Click Microflow

When set, an extra button will appear in the InfoWindow pop-up. This button can trigger a Mendix Microflow. The microflow needs the entity selected at ‘Data Source’ > ‘Objects’ as an inputparameter.

•    On Click Button Label

Give the button, appearing in the infowindow, a label like ‘Open’ or ‘Edit’

•    On Click Button Class

Give the button extra classes, to adjust the appearance of the button in the infowindow.

6. Environment

In this tab pane settings can be applied to distinguish between environments (Test, Dev, Accp, Prod) of a client. It could very well be that different Mendix environments connect to different ArcGIS environments. Those settings should typically be stored in a constant and retrieved via a DataSource microflow. These datasource microflows in turn, can be selected in the widget

•    Get HostName Microflow

This microflow should retrieve the hostname of the ArcGIS server. Note: This is the part before /arcgis/rest/services.

•    Get FeatureServerName Microflow

(Only applicable when set, see note 2) This microflow should retrieve the environment specific postfix for the Layer URL.

Note: This is the first part after /arcgis/rest/services/

Note 2: If not set, the default feature server name as configured in the Layer URL will be used.

Releases

Version: 1.3.0
Framework Version: 8.6.4
Release Notes: - Upgraded to Mendix 8(.6.4) - Bugfix 1: only overrule default ArcGIS styling when asked for in Modeler and only for query layer - Bugfix 2: Only allow at maximum 1000 objects in Mendix to be fed to query defintion, lese ArcGIS server will struggle with amount of data. - Bugfix 3: Only when search is enabled add placeholder text. When search was disabled this gave an error in browser consoleNew - Bugfic 4: Added overflow-x = "auto" to legend, needed if there are many layers loaded having more height than window - Improvement: modal progress bar added when loading the objects from Mendix on the ArcGIS map - New Feature 1: Use Dynamic Host Name - New Feature 2: if FeatureServer only has one layer, the legend will show the amount of objects loaded in that layer - New Feature 3: if full width (set width to 10.000) is selected, stretch to 95 % percent of the view width - Made JS code non-minified in this release, since Mendix webpack bundling logic breaks minified code...
Version: 1.2.2
Framework Version: 7.23.6
Release Notes: Fix for unsubscribe not working in listen-to-grid scenario in Mendix 7.23.6
Version: 1.2.1
Framework Version: 7.22.2
Release Notes: Changed relative path for dojox folders to ArcGIS/lib/dojox since as of Mendix 7.22 some dojox modules have been removed from Mendix hence should be retrieved from widget instead.
Version: 1.2.0
Framework Version: 7.16.0
Release Notes: Fix for uglified js code generating multiDefine errors even though 'Check Widgets' feature states widget is correctly built
Version: 1.1.1
Framework Version: 7.13.1
Release Notes: For both polygons and points in the query layer, styling can be overruled based on the color of the object in Mendix.