Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The ArcGIS REST map engine is similar to the ArcGIS Soap map engine but it utilises the ArcGIS REST API to communicate with ArcGIS, rather than the SOAP API used by the ArcGIS SOAP mapengine.

Namespace

urn:com.cohga.server.map.arcgis.ws#1.0

Tags

mapengine

Properties


Name

Type

Required

Default

Description

id

string

yes


Unique identifier for this map engine, will be used by other items to refer to this map engine

url

string

yes


The URL used to connect to the ArcGIS server, e.g. http://vmbreakout:6080/arcgis/rest/services/Topo250/MapServer

mapcache

boolean

no

false

Should a tile cache be used (if it's available). If this is false or not set then any tile cache generated for the map service won't be used

username

string

no


A username to connect to the server as

password

string

no


A password to connect to the server as, should be encrypted using 'encrypt' at the OSGi prompt

usename

boolean

no

false

Use the layer name to refer to individual layers, especially useful when building a ToC model since the names don't change as often as the id. You should ensure that the layer name is unique if you set this to true. If not set or set to false then the layer identifiers for each layer (which are used in ToC models, amongst other things) will be taken from the order that the layer appears within the .mxd file, which can change if layers are added/removed from the .mxd file. If set to true then the label that appears in the .mxd file will be used as the identifier instead

transparent

boolean

no

false

If true then ArcGIS is asked to generate an image that is transparent where no map data is drawn

layers

#layers

no


Alter the layer information from ArcGIS

legend

#legend

no


Alter the display of the legend

direct

boolean

no

false

If true then Weave will send the URL's returned from ArcGIS directly to the client rather than proxying them on behalf of ArcGIS. This will help performance if ArcGIS is accessed internally and the clients can access the URL's the ArcGIS returns.

referer

string

no


Referer header value when sending HTTP requests to ArcGIS server (since com.cohga.server.map.arcgis.ws bundle version 2.38.48)

This is useful if ArcGIS server filters all requests by header value by comparing the referer domain against a list of whitelisted domains.

It is probably better to set the referer value in the tokenservice config, since chances are that it is really just required as part of authentication token generation, and not just general request filtering, but if you are performing request filtering in ArcGIS based on the referer header then you should set it here (and probably in the token service config too unless you're using IP or Request IP ).

ignoregroups

boolean

no

true

Should Weave ignore the groups when working with ArcGIS map documents.

When Weave works with map layers it only deals with the layers themselves, groups don't come into play until you start creating a ToC model, and even then the grouping in ToC models is not used when referring to map layers (they're only used internally on the client to turn on/off a collection of individual layers). Normally this works fine for ArcGIS as Weave will ensure that if a layer is "visible", then all of its parent groups (on the ArcGIS side) will also be turned on. This ensures that the layer is actually visible (as a layer won't be displayed if it's visible but one or more of its parents aren't). This way you can setup your AGS map document however you want (with or without groups) and have the Weave ToC model be the single source of group related information for the ToC panel, and then Weave will ensure that the map layers that need to be drawn are drawn.

However, sometimes it's desirable to have Weave recognize the groups (that's the ArcGIS map document groups, not ToC model groups) and have them treated as layers. By

setting ignoregroups to false Weave

setting ignoregroups to false Weave will include entries in the map engine description for the groups as well as for the layers. In this case the ToC model and the ArcGIS map document groups will, in combination, be responsible for determining whether a layer is visible or not.

username

string

no


Username used to generate tokens. You should not set this, but instead include it in the tokenservice configuration

password

string

no


Password used to generate tokens.  You should not set this, but instead include it in the tokenservice configuration

tokenservice

string or #tokenservice

no


This can be a simple string providing the token service URL to override the one provided by ArcGIS, in which case you will need to set username and password properties above too, but you should use this as a sub-tag and include all the required information inside of that instead.


Sub-tags


Name

Type

Cardinality

layers

#layers

0..1

legend

#legend

0..1

tokenservice

#tokenservice

0..1


Content

None

layers

Properties

None

Sub-tags


Name

Type

Cardinality

remove

#remove

0..1

layer

#layer

0..n


Content

None

remove

Properties

None

Sub-tags


Name

Type

Cardinality

layer

#layer

0..n


Content

None

layer

Properties


Name

Type

Required

Description

id

number

no

The id of the layer to match

name

string

no

The name of the layer to match


Sub-tags

None

Content

The id or name, depending upon the the usename property property, of the layer to match

Notes

  • The 

    The layer

     tag

     tag support two formats, one using

    the 

    the id

     and

     and/

    or 

    or name

     attributes

     attributes and the other using the tags content

  • Either one or both of

    the 

    the id

     and

     and/

    or 

    or name

     attributes

     attributes must be set OR tag content must be provided

  • If the content of

    the 

    the layer

     tag

     tag is used then the value of

    the 

    the usename

     property

     property determines if the content should match the layer id or the layer name

  • Both

    the id and name attributes

    the id and name attributes can be set, but they must match both values for the layer that you're trying to filter or they won't match the layer

legend

Alter the display of the legend

Properties

None

Sub-tags

Name

Type

Cardinality

remove

#remove

0..1

aliases

#aliases

0..1


Content

None

aliases

List the new labels to be displayed for a layer

Properties

None

Sub-tags

Name

Type

Cardinality

alias

#alias

1..n


Content

None

alias

A single label change for a layer

Properties

Name

Type

Required

Description

id

string

yes

The id of the layer to change. Note if a match is not found for the id the label of the layer will be then be searched for.

label

string

yes

The new label to display

Sub-tags

None

Content

None

tokenservice

Provide the configuration information to allow Weave to talk to ArcGIS to generate tokens for authentication

Properties

Name

Type

Required

Description

username

string

no

Used with password when requesting a token from ArcGIS

password

string

no

Used with username when requesting a token from ArcGIS

token

string

no

Can be provided instead of username and password and will be used when requesting a token from ArcGIS

url

string

no

Override the token generation endpoint that ArcGIS provides

timeout

integer

no

Number of seconds to timeout connections and requests sent to the token generation endpoint. Default is 0, which mean use the default system timeout.
This sets both connectiontimeout and readtimeout so use those rather than this property if you want different values for each.

connectiontimeout

integer

no

Number of seconds to timeout the connections to the token service

readtimeout

integer

no

Number of seconds to timeout requests sent to the token service

Notes

Any additional properties specified in the token service config will be included in the request sent to ArcGIS to generate the tokens, this can include things like referer if the token service requires a referer value.

Either username and password must be provided, or just token.

For the url parameter:

  • if the value starts with "https://" or "http://" (you should really not

    use http

    use http://), the value will be used as is

  • if the value starts with "//", then "https:" will be prepended to the value

  • if otherwise, the value will be prepended with the schema, host and port used for the map service itself

  • if the value is not set, Weave will query ArcGIS (based on the map engine URL) for the URL to use.

Examples:

Service URL

Token Service Value

Final URL

N/A

https://example.com/arcgis/tokens/

https://example.com/arcgis/tokens/

N/A

http://example.com/arcgis/tokens/

https://example.com/arcgis/tokens/

N/A

https://example.com:6443/arcgis/tokens/

https://example.com:6443/arcgis/tokens/

N/A

http://example.com:8080/arcgis/tokens/

http://example.com:8080/arcgis/tokens/

N/A

//example.com:6443/arcgis/tokens/

https://example.com:6443/arcgis/tokens/

N/A

//example.com:8080/arcgis/tokens/

https://example.com:8080/arcgis/tokens/

https://example.com/arcgis/rest/map/MapServer

/arcgis/tokens/

https://example.com/arcgis/tokens/

http://example.com/arcgis/rest/map/MapServer

/arcgis/tokens/

http://example.com/arcgis/tokens/

https://example.com:6443/arcgis/rest/map/MapServer

/arcgis/tokens/

https://example.com:6443/arcgis/tokens/

http://example.com:8080/arcgis/rest/map/MapServer

/arcgis/tokens/

http://example.com:8080/arcgis/tokens/

Examples

Simple ArcGIS definition

...

Code Block
languagexml
<arcgisws:mapengine id="arcgis.roads">
    <url>http://vmbreakout:6080/arcgis/rest/services/Roads/MapServer</url>
    <crs>EPSG:28355</crs>
    <transparent>true</transparent>
    <usename>true</usename>
</arcgisws:mapengine>


Configuring token generation
Code Block
languagexmltitleConfiguring token generation
<arcgisws:mapengine id="example1">
    <url>https://arcgis.lan/arcgis/rest/services/Roads/MapServer</url>
    <username>weave</username>
    <password>ENCAFDHASNADGQAEDAS</password>
</arcgisws:mapengine>

<arcgisws:mapengine id="example2">
    <url>https://arcgis.lan/arcgis/rest/services/Roads/MapServer</url>
    <tokenservice>
        <username>weave</username>
        <password>ENCAFDHASNADGQAEDAS</password>
    </tokenservice>
</arcgisws:mapengine>

<arcgisws:mapengine id="example3">
    <url>https://arcgis.lan/arcgis/rest/services/Roads/MapServer</url>
    <tokenservice>
        <token>D9Tk_kRQbq4bkJQSMOgSkKjy7OGSfTO5rtafQ77Ha0gEmRw5dc6vhTSN5MG5vmd__-T0tMSaLZxlUf8ZLZGrDmNbnBjd1_nqt5y_U7HA4yA.</token>
    </tokenservice>
</arcgisws:mapengine>

<arcgisws:mapengine id="example4">
    <url>https://arcgis.lan/arcgis/rest/services/Roads/MapServer</url>
    <tokenservice>
        <url>/sharing/rest/generateToken/</url>
        <username>weave</username>
        <password>ENCAFDHASNADGQAEDAS</password>
        <referer>https://weave.lan/weave/main.html</referer>
    </tokenservice>
</arcgisws:mapengine>

<arcgisws:mapengine id="example5">
    <url>https://arcgis.lan/sharing/rest/services/Roads/MapServer</url>
    <tokenservice>
        <url>https://portal.arcgis.lan/sharing/rest/generateToken/</url>
        <token>D9Tk_kRQbq4bkJQSMOgSkKjy7OGSfTO5rtafQ77Ha0gEmRw5dc6vhTSN5MG5vmd__-T0tMSaLZxlUf8ZLZGrDmNbnBjd1_nqt5y_U7HA4yA.</token>
        <serverUrl>https://arcgis.lan/arcgis</serverUrl>
    </tokenservice>
</arcgisws:mapengine>


Altering legend output
Code Block
languagexmltitleAltering legend output
<arcgisws:mapengine id="example4">
  <url>https://arcgis.lan/arcgis/rest/services/Roads/MapServer</url>
  <legend>
    <remove>
      <layer>easetxt</layer>
      <layer>house_numbers</layer>
    </remove>
    <aliases>
      <alias id="property" label="Properties"/>
    </aliases>
  </legend>
</arcgisws:mapengine>

...