LogoLogo
English
English
  • Welcome to JMap Server Kathmandu
  • Administrator
    • JMap Server Administrator Manual
      • Introduction
        • Quick Start Guide
        • User Interface
      • Databases
        • System Database
        • Creating Databases
        • Configuring and Managing Databases
        • SQL Console
      • JMap Server to JMap Server Connections
        • Creating Connections to JMap Server
        • Configuring JMap Server to JMap Server connections
          • Permissions for the remote connection
        • Managing connections
      • Spatial Data Sources
        • Creating Spatial Data Sources
        • Configuring Spatial Data Sources
          • Spatial Data Source Permissions
          • External Attributes
          • Metadata
        • Sharing Spatial Data Sources
        • Vector Data Sources
          • JMap ADF - E00 Arc - Info reader
          • JMap CSV reader
          • JMap DGN V7 - V8 File reader
          • JMap DWG - DXF reader
          • JMap EDIGEO reader
          • JMap File geodatabase reader
          • JMap GeoJSON reader
          • JMap GML reader
          • JMap GPX reader
          • JMap IFC reader
          • JMap KML reader
          • JMap MID - MIF reader
          • JMap Photo reader
          • JMap SHP reader
          • JMap TAB reader
          • Annotations in a database
          • ArcGIS REST
          • ArcSDE geodatabase
          • Coordinates in a database
          • Enterprise geodatabase
          • JMap Server
          • JMap Spatial Table
          • MongoDB
          • MySQL Spatial
          • OGC API Features
          • Oracle Spatial Locator
          • Personal geodatabase
          • PostGIS
          • SQL Server Spatial
          • WFS Server
          • WKB or WKT in a database
        • Raster Data Sources
          • ECW - JPG2000
          • GDAL - Geospatial Data Abstraction Library
          • ArcGIS REST
          • JMap Server
          • OpenStreetMap
          • WMS server
          • WMTS Server
      • Projects
        • Creating Projects
          • Vector tiles in JMap
          • Multilingual Projects
        • Configuring Projects
          • Project Permissions
          • Organizing Layers
          • Attribute Queries
            • Attribute Query Forms
          • Personal Layers
        • Managing Projects
        • Style Templates
      • Layers
        • Managing layers in a project
        • Creating Layers
        • Configuring Layers
          • General Settings
          • Layer Permissions
          • Dynamic Filters
          • Style
          • Thematics
          • Labels
          • Mouseover
          • Information Reports
          • Forms
            • Layer Attributes Forms
            • Database Forms
        • JMap extensions
        • Sharing Layers
      • JMap Server Applications
        • Classical applications
          • JMap Pro Applications
          • JMap Web Applications
            • Using a GeoWebCache Server
          • WFS and WMS Services
        • New generation applications
      • JMap Server Extensions
      • Security
        • Managing Users
          • JMap DB user manager
          • Composite user manager
          • Active Directory user manager
          • JMap LDAP user manager
          • OpenID Connect (OIDC) user manager
          • SAML2 user manager
        • Managing User Accounts and Groups
          • Single Sign-On for JMap Pro
        • Managing Permissions
        • Managing Sessions
        • Using HTTPS with JMap
      • JMap Server Management
        • JMap Server Status
        • Exporting and Importing
        • User Data
        • JMap Server Settings
        • Usage Statistics
        • Log Files
        • Messages
        • JMap Server System Database
        • Backups
      • Advanced Features: Debugging Tools
    • Technical Specifications
    • Installation Guide
    • Installing and Starting JMap (with installer)
    • Installing and Starting JMap (in a Docker container)
    • Migration Guide to JMap Server Kathmandu
  • Applications User
    • JMap Server Applications
    • JMap Pro User Guide
      • Introduction
        • User Interface
        • Navigating on the Map
        • Map Management
        • Map Settings
      • Map Layers
        • Layer Management
        • Elements Explorer
        • Thematic Maps
        • Layer Metadata
        • Layer Settings
          • General
          • Style
          • Thematics
          • Labeling
          • Mouseover
          • Filters
          • Advanced
        • Editable Layers
          • Editing Data
          • Personal Layers
      • Tools
        • Labeling
        • Interactive Selection
        • Information Tools
          • Information Report
          • Geometry Information
          • Mouseover
        • Snap
        • Measurement
        • Search Tools
          • Attribute Queries
          • Spatial Queries
        • Collaboration Tools
          • Map Contexts
          • Sharing Maps
          • Printing Maps
      • Application Settings
      • Keyboard and Mouse Shortcuts
    • 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
          • Filter Elements on the Map
          • Making Layer Elements Selectable
      • I Wish to...
        • Display Element Information
          • Tooltips
          • Information Reports
        • Perform Searches
        • Select Elements on the Map
        • Measure Distances and Surfaces
        • Add Annotations to the Map
        • Edit Data
        • Create and Manage Customized Maps
        • Export / Print a Map
    • JMap Survey User Guide
      • Introduction
        • Working With an iOS Device
        • Working With an Android Device
        • Logging In
        • User Interface
      • The Data
      • I Wish to...
        • Access Information Associated With an Object
        • Perform Searches
        • Create Objects
        • Modify Objects
        • Work in Offline Mode
        • Synchronize Data with JMap Server
        • Log Out
    • JMap Web User Guide
  • JMap Server Extensions
    • Edition
      • JMap Edition User Guide
        • User Interface
        • Basic Concepts
        • I Wish to...
          • Edit Layers Geometries
            • Edition Tools
            • Selecting Elements
            • Node and Polygon Operations
            • Vertical Position and Element Duplication
            • WKT Geometries
          • Perform Spatial Operations
            • Geoprocessing
            • Spatial Tools
    • Export
      • JMap Export User Guide
    • Import
      • JMap Import User Guide
        • Importation Procedure
          • Importing MIF Files
          • Importing SHP Files
          • Importing CSV Files
          • Importing NMEA Data
          • Importing Data From WMS
    • Tracking
      • Administrator
      • User
    • Documents
      • Documents 7
      • JMap Documents User Guide
        • Configuring JMap Documents
          • Selecting the data sources to which documents can be associated
          • Configuring document depots
          • Managing depots
          • Making the extension available in apps
        • Documents for JMap Pro
          • Graphical interface
          • Associating documents with map elements
          • Searching for documents
          • Displaying the list of documents associated with elements
        • Documents for JMap NG
          • Graphical interface
          • Searching documents
          • Showing selected documents
        • Documents for JMap Survey
  • Developer
    • JMap Server REST API
    • JMap Admin REST API
    • JMap Pro / Server API
    • JMap Web API
    • Developer Manual
    • JMap NG Developer Manual
  • Knowledge Base
    • Knowledge Base
Propulsé par GitBook

K2 Geospatial 2022

Sur cette page
  • Providing mouseover content
  • Mouseover syntax
  • Examples
  • Locating map elements or coordinates using mouseover
  • Using a URL to display content
Exporter en PDF
  1. Administrator
  2. JMap Server Administrator Manual
  3. Layers
  4. Configuring Layers

Mouseover

PrécédentLabelsSuivantInformation Reports

Dernière mise à jour il y a 1 an

Mouseover bubbles are meant to display information about the elements they are pointing to. This information includes text, attribute values, hyperlinks, images, etc. The JMap administrator determines what information is displayed in the bubbles of each layer.

The content of mouseover bubbles can be formatted using HTML tags. Mouseover bubbles can also contain JavaScript programs.

To configure mouseover for a layer, click on Mouseover in the details section of the layer.

Mouseover

Mouseover

Enter the content of the mouseover bubble. See sections below for an explanation of the syntax.

Background color

Select the background color of the mouseover bubble.

Prevent text duplication

Select this option to prevent the same text from being repeated many times within the same bubble. This can happen when pointing to many map elements on the same layer that have the same mouseover content (e.g. street segments at an intersection).

Minimum scale

Activate this option and enter the minimum scale from which the mouseover bubble must be displayed.

Maximum scale

Activate this option and enter the maximum scale from which the mouseover bubble must be displayed.

Providing mouseover content

You must provide the text that will be used as the content of the bubble. This text can be comprised of static parts (displayed as is), variable parts (replaced at display time by another value), simple JavaScript programs, and HTML tags. For instance, the elementValue(city) function will be replaced at display time by the value of the city attribute for the pointed element.

Mouseover syntax

The mouseover syntax is comprised of various functions that will determine the content of the bubbles. Functions and their parameters are generally not case sensitive. For instance, ev(city) is equal to Ev(CITY).

The following table explains the various available functions:

Function

Description

elementValue(attrib) or ev(attrib) attrib: the name of an attribute

Replaced by the value of the bound attribute whose name is passed as a parameter for the pointed element. For example, ev(id) will be replaced by the value of the id attribute for this element.

elementId()

Replaced by the element identifier.

polygonArea()

Replaced by the area of a pointed polygon type element.

lineLength()

Replaced by the length of a pointed line type element.

centroid()

Replaced by the coordinates of the geometric centroid of the element's geometry.

format(attrib, format) attrib: the name of a date or numerical attribute format: the desired date format

ifNull(attrib, value) attrib: the name of the attribute to test value: the value to display if attrib is null

Replaced by the value value only if the value of the attrib attribute is null. If the attribute value is not null, nothing is displayed. Example ifNull(temp, N/A) Displays N/A if the value of the temp attribute is null. Example ifNull(attrib_a, attrib_b) Displays the value of the attrib_b attribute if the value of the attrib_a attribute is null.

ifNotNull(attrib, value) attrib: the name of the attribute to test value: the value to display if attrib is not null

Replaced by the value only if the value of the attrib attribute is not null. If the attribute value is null, nothing is displayed. Example ifNotNull(land_value, $) Displays only if the value of land_value is not null.

subString(attrib, startIx, endIx) attrib: the name of the attribute for which a part must be extracted. startIx: starting position in the character string. endIx: ending position in the character string.

Replaced by a portion of the value (as a character string) of the attrib attribute, between the startIx position and endIx position. Example subString(name, 0, 5) Replaced by the first five characters of the name attribute value. If this value is Montreal, the mouseover will display Montr.

encode(attrib, encoding) attrib: the name of the attribute to code encoding: the name of the encoding

Replaced by the value of the attrib attribute once it is encoded with the specified character encoding (UTF-8, CP437, ISO 8859-1, etc). Example encode(name, UTF-8) Replaced by the value of the name attribute encoded in UTF-8 characters.

<script> code JavaScript</script>

Runs the JavaScript code found between the tags. In JavaScript, the attribute values of the elements are accessible through the elementValue() or ev() function. Mathematical operations or character string operations can be performed on attribute values. To display content in the mouseover, the script must call on the print() function. Example <script> print ( ev(population) / ev(area) ); </script> Calculates and displays the result of the value of the population attribute divided by the value of the area attribute. Example <script> var KM_IN_MI = 0.621371; var dist_mi = ev(km) * KM_IN_MI; print('ev(osm_name)'); print(dist_mi.toFixed(1) + " mi"); </script> Converts the distance in kilometers contained in the value of the km attribute into miles. Displays the value of the osm_name attribute and the distance in miles with a decimal figure.

<a href="download:file URL">some text</a>

JMap supports a special hyperlink syntax that allows a user to download a file by clicking on the link. The file to download can come from a http: or a file: URL. Example <a href="download:http://someserver/123/report.pdf">Download</a> Displays a link that can be used to download the report.pdf file from the web. Example <a href="download:file://D:/123/report.pdf">Download</a> Displays a link that can be used to download the report.pdf file from a Windows file system folder.

photosAsThumbnails()

Replaced by smaller versions of the images attached to the element. The user can click on a thumbnail to open the full size image. photosAsThumbnails(title) photosAsThumbnails(date) photosAsThumbnails(title,date) With these options, the title and/or date will be displayed with each thumbnail. It is very important that you do not add any spaces between title, the comma, and date.

projectName()

Replaced by the name of the current project.

userName()

Replaced by the user code of the user that is currently connected.

sessionId()

Replaced by the identifier of the current session.

host()

Replaced by the name of the host or address of the JMap Server instance to which the application is connected.

port()

Replaced by the port number (http or direct) of the JMap Server instance to which the application is connected.

date()

Replaced by the current date and time.

HTML content

The content of the bubble can be formatted using simple HTML tags. Mouseover bubbles do not support CSS or advanced tags such as <DIV>. The following HTML tags are supported and frequently used in mouseover:

<B>, <I>, <U>, <A>, <IMG>, <TABLE>, <BR>

You can insert hyperlinks in mouseover bubbles. These hyperlinks can be clicked, and they allow users to open HTML pages or to open or download files.

Examples

Mouseover content

Display

City : ev(CITY) A simple example of static text with the value of an attribute.

City: ev(CITY) (ev(COUNTRY)) Example containing static parts and displaying 2 attribute values on 2 lines.

<b>ev(STATION_NAME)</b> <a href="ev(URL)">Site web</a> An example of basic formatting using HTML tags and a hyperlink where the URL comes from the value of the URL attribute.

<b>ev(DESCRIPTION)</b> <img src="ev(IMAGE_URL)" height="175" width="234" /> An example of an HTML tag that takes the image URL from the value of the IMAGE_URL attribute.

Area : ev(AREA_KM2) km2 <script> var SQ_KM_IN_SQ_MI = 2.58998811; var area_sq_mi = ev(AREA_KM2) / SQ_KM_IN_SQ_MI; print(area_sq_mi.toFixed(1) + " sq. mi"); </script> An example of a <script> tag with JavaScript code. The value of the AREA_KM2 attribute is converted from square kilometers to square miles.

<table style="border:3px solid black; border-radius:5px; background: #1fc8db; color:white"> <thead> <tr> <th style="padding: 5px" class="">Name</th> <th style="padding: 5px" class="actions">FirstName</th></tr> </thead> <tbody> <tr> <td style="padding: 5px" class="">Gratton</td> <td style="padding: 5px" class="actions">Bob</td> </tr> </tbody> </table> An example of formatting with a style attribute.

Locating map elements or coordinates using mouseover

Mouseover supports a function to locate map coordinates or elements using a special URL syntax. A hyperlink is displayed in the bubble, and when it is clicked, the map locates the specified element(s) or region. This function is only available in JMap Pro.

Mouseover locate example

Description

<a href="locate:region;-73;45;5;5">Locate</a>

Displays a Locate hyperlink. When clicked, locates the region defined by x=-73, y = 45, width = 5, height = 5 in the same map. This is expressed in the map's units.

<a href="locate:object;subway;name;'atwater'">Locate</a>

Displays a Locate hyperlink. When clicked, locates the elements on the subway layer that have their attribute name equal to atwater in the same map.

<a href="locate:object;subway;name;'a%'">Locate</a>

Displays a Locate hyperlink. When clicked, locates the elements on the subway layer that have their attribute name starting with letter a in the same map.

<a href="locate:object;subway;name;'atwater';1000">Locate</a>

Displays a Locate hyperlink. When clicked, locates the elements on the subway layer that have their attribute name equal to atwater in the same map. The resulting map has a scale of 1 : 1000.

<a href="locate:object;subway;name;'atwater':target=Result">Locate</a>

Displays a Locate hyperlink. When clicked, locates, in a new map called Result, the elements on the subway layer that have their attribute name equal to atwater. If a map called Result already exists, it is reused. If the name of the map was new, a new map (with an automatically generated name) would be created each time.

Using a URL to display content

You can specify a URL that opens an HTML page to display in the mouseover bubble (only supported in JMap Pro). The HTML page will occupy 100% of the bubble. The syntax is as follows:

$URL{http://awebsite.com}

The specified URL can be static or it can come from an attribute. It can also use attribute values as parameters, as shown below:

$URL{http://awebsite.com?param1=ev(ATTRIB_A)&param2=ev(ATTRIB_B)}

Replaced by a number or date that was formatted according to a specific format. Example format(date_insp, dd/MM/yyyy) where date_insp is the name of an attribute containing a date and dd/MM/yyyy is the desired date format, as indicated in the documentation of the Java class. Example format(attrib, ##0,00) where attrib is the name of an attribute containing a number and ##0,00 is the desired number format, as indicated in the documentation of the Java class.

/

java.text.SimpleDateFormat
java.text.DecimalFormat