HTTPTupleView provides default mapping visualization of tuple data that contains latitude and longitude. Each tuple in the window represents an object to be mapped and must include these attributes (as SPL or JSON attributes):
- id - A unique identifier for the object being mapped. The identifier must be unique within its layer.
- float64 longitude - Longitude of the object's location.
- float64 latitude - Latitude of the object's location.
These attributes are optional:
- layer - Identifier for the layer the item will be placed on. If not set a default layer of Markers is used. Type is rstring or ustring.
- markerType - Marker used at the item's position on the map. Can be of type MarkerType or an rstring containing the enumeration's values (e.g. GREEN) or a path to an icon file. If this attribute is not present in the tuple then BLUE is used.
- note - HTML for the popup that appears when the item's position marker is clicked. If this attribute is not present then the popup contains a string representation of the tuple.
When
markerType is an path to an icon file there are three options:
- A path within a context specified by the context parameters. Note that any context can be used as long as the operator that specifies it has been fused with the HTTPTupleView operator and is using the same port. For example the com.ibm.streamsx.transportation toolkit might provide an WebContext operator that defines a streamsx.transportation context containing bus icon at /streamsx.transportation/icons/bus.png.
- A path within the application's default context which maps to application_dir/opt/html. For example if the application directory contains opt/html/icons/drone.png then the path /icons/drone.png will map to that icon.
- A external URL.
Access to the map is provided by the auto visualization table located at the URL streamsx.inet.resources/dojo/viewall.html. Locate the link in the table corresponding to the input port containing the mappable data.
Mapping is provided using http://www.openlayers.org/api/OpenLayers.js thus internet connectivity is required to use the default mapping. Note only when the mapping is accessed through its URLs is internet connectivity required.
Content
- Types
-
- MappedPosition: Convenience type that corresponds to the expected attributes for the default mapping visualization.
- MappedPositionIcon: Convenience type that corresponds to the expected attributes for default mapping visualization using icon path for markers and a note.
- MappedPositionIconLayer: Convenience type that corresponds to the expected attributes for default mapping visualization using a layer, icon path for markers and a note.
- MappedPositionMarker: Convenience type that corresponds to the expected attributes for default mapping visualization using the pre-defined markers and a note.
- MappedPositionMarkerLayer: Convenience type that corresponds to the expected attributes for default mapping visualization using a layer, pre-defined markers and a note.
- MarkerType: Type of the marker to display for a point on the default map visualization by HTTPTupleView.
Types
MarkerType
MarkerType = enum { BLUE, GREEN, YELLOW, RED, WARNING, AWARD };
MappedPosition
Convenience type that corresponds to the expected attributes for the default mapping visualization.
MappedPosition = tuple<rstring id, float64 latitude, float64 longitude>;
MappedPositionMarker
Convenience type that corresponds to the expected attributes for default mapping visualization using the pre-defined markers and a note.
MappedPositionMarker = MappedPosition, tuple<MarkerType markerType, rstring note>;
MappedPositionIcon
Convenience type that corresponds to the expected attributes for default mapping visualization using icon path for markers and a note.
MappedPositionIcon = MappedPosition, tuple<rstring markerType, rstring note>;
MappedPositionMarkerLayer
Convenience type that corresponds to the expected attributes for default mapping visualization using a layer, pre-defined markers and a note.
MappedPositionMarkerLayer = MappedPositionMarker, tuple<rstring layer>;
MappedPositionIconLayer
Convenience type that corresponds to the expected attributes for default mapping visualization using a layer, icon path for markers and a note.
MappedPositionIconLayer = MappedPositionIcon, tuple<rstring layer>;