public class Renderer extends EventProvider
Modifier and Type | Class and Description |
---|---|
static class |
Renderer.events |
static class |
Renderer.poiFlag
POI layers creation flags, used upon layer creation
|
static class |
Renderer.zonesFlag
Geofence layers creation flags, used upon layer creation
|
Constructor and Description |
---|
Renderer() |
Modifier and Type | Method and Description |
---|---|
void |
createMessagesLayer(LayerSpec params,
LayerResponseHandler callback)
Create new messages layer into renderer, require ACL Item.accessFlag.execReports
|
void |
createPoiLayer(java.lang.String layerName,
POISpec[] pois,
int flags,
LayerResponseHandler callback)
Create POI layer into renderer, require ACL Resource.accessFlag.viewPoi to resource items
|
void |
createZonesLayer(java.lang.String layerName,
ZonesSpec[] zones,
int flags,
LayerResponseHandler callback)
Create Geofence layer into renderer, require ACL Resource.accessFlag.viewZone to resource items
|
void |
enableLayer(Layer layer,
boolean enable,
ResponseHandler callback)
Enable or disable layer.
|
java.util.List<Layer> |
getLayers()
Get layers
|
Layer |
getReportLayer()
Get report layer
|
java.lang.String |
getTileUrl(int x,
int y,
int z)
Get URL for 256x256 GMaps style tile
|
int |
getVersion()
Active, incremental version of renderer, version property is incremented when picture is changed and redraw required
|
void |
hitTest(double lat,
double lon,
int scale,
double radius,
java.lang.String layerName,
ResponseHandler callback)
Perform hit test over coordinates over all layers in renderer
|
void |
removeAllLayers(ResponseHandler callback)
Remove all layers from renderer
|
void |
removeLayer(Layer layer,
ResponseHandler callback)
Remove layer from renderer
|
void |
setLocale(int tzOffset,
java.lang.String language,
int density,
ResponseHandler callback) |
void |
setLocale(int tzOffset,
java.lang.String language,
ResponseHandler callback)
Initialize/update localization settings,
|
addListener, clearListeners, fireEvent, removeListener, removeListeners
public int getVersion()
public java.util.List<Layer> getLayers()
public Layer getReportLayer()
public java.lang.String getTileUrl(int x, int y, int z)
x
- X coordinate (lon?)y
- Y coordinate (lat?)z
- Z coordinate (zoom)public void setLocale(int tzOffset, java.lang.String language, ResponseHandler callback)
tzOffset
- timezone offset, see wialon.util.DateTimelanguage
- 2byte language code, e.g.: ru, en, de, ...callback
- function that is called after renderer initializationpublic void setLocale(int tzOffset, java.lang.String language, int density, ResponseHandler callback)
public void createMessagesLayer(LayerSpec params, LayerResponseHandler callback)
params
- layer parameters, format: {layerName: text, itemId: long, timeFrom: uint, timeTo: uint, tripDetector: bool, trackColor: text, trackWidth: int, arrows: bool, points: bool, pointColor: text, annotations: bool}callback
- callback that will receive information about new layer additionpublic void createPoiLayer(java.lang.String layerName, POISpec[] pois, int flags, LayerResponseHandler callback)
layerName
- layer namepois
- POI to render specification in form: [{resourceId: ID, poiId: [id1, id2, id3]}]flags
- layer rendering flags, see wialon.render.Renderer.PoiFlag for more detailscallback
- callback that will receive information about new layer additionpublic void createZonesLayer(java.lang.String layerName, ZonesSpec[] zones, int flags, LayerResponseHandler callback)
layerName
- layer namezones
- Zones to render specification in form: [{resourceId: ID, zoneId: [id1, id2, id3]}]flags
- layer rendering flags, see wialon.render.Renderer.ZonesFlag for more detailscallback
- callback that will receive information about new layer additionpublic void removeLayer(Layer layer, ResponseHandler callback)
layer
- layer which to removecallback
- callback that will receive information about new layer removalpublic void enableLayer(Layer layer, boolean enable, ResponseHandler callback)
layer
- layer to enable or disableenable
- true to enable layer, false - to disablecallback
- callback that will receive information about layer updatepublic void removeAllLayers(ResponseHandler callback)
callback
- callback that will be called after all layers are removedpublic void hitTest(double lat, double lon, int scale, double radius, java.lang.String layerName, ResponseHandler callback)
lat
- point latitudelon
- point longtitudescale
- scale in some adsa-known metricsradius
- maximum possible range till object, probably in degreeslayerName
- maybe zero string (value: "")callback
- callback, that get result in form callback(code, result), where zero code mean success, result is complex object, which fields depending on type of hitted layer