SafeNet/SDMaps/docs
Laurențiu Constantin 96b2bf8b22 Initial commit 2021-02-24 13:50:23 +02:00
..
PTT_states.png Initial commit 2021-02-24 13:50:23 +02:00
PTT_states.puml Initial commit 2021-02-24 13:50:23 +02:00
README.md Initial commit 2021-02-24 13:50:23 +02:00
compile.sh Initial commit 2021-02-24 13:50:23 +02:00
readme.sh Initial commit 2021-02-24 13:50:23 +02:00

README.md

Wednesday, 7 May 2014

Commands reference

setdataset

setdataset,name,lat1,lng1,time1,name1,speed1,altitude,adresa1,icon_name1,voiceTimeout,smsLength,isInCall...

Examples:

    setDataset,vehicles_positions,46.591381765902,-113.577594361268,2015-05-21 17:21:36,DANIEL DAVIS 56,71 mph,928 meters,Bucharest Bulevardul Marasesti 25,arrow_e.png,5,141,true
	
    setDataset,vehicles_positions,36.314,-88.613,demo2,Speed: 90 Km/h Time: 23:54<br>503 Watts Rd Dresden TN 38225 USA,bigcar0.png,37.314,-89.613,Demo101,Speed: 90 Km/h Time: 23:54<br>254-448 Estate Dr Cape Girardeau MO 63701 USA,dodge.png
    setDataset,shape3,45.2,46.4,,,,45.3,46.5,,,,45.4,46.6,,,

Each point needs to be specified with exactly 5 params. If they are empty, simply leave blank. A smsLength of 0 or non-existent means the unit does not support sms. voiceTimeout is the number of seconds after which a call goes to failed.

setCall

setCall,unitName,true|false

Examples:

setCall,TRBO103,true
setCall,Demo101,false

updatedataset

updatedataset,name,points

It will update the points with the specified names in the specified dataset. See setdataset for the points format.

Examples:

updateDataset,LandView,53.330872983017,18.6328125,airport,New,fire_department.png

deletefromdataset

deletefromdataset, name, name1, name2,...

Remove points from dataset.

removeDataset

removedataset, name

Removes a dataset.

putOnMap

putonmap,autosize,datasetName
autosize = true|false

Will display a dataset on the map. If autosize is true the map will zoom in or out and resize so that all the points in dataset will be visible.

Examples:

putOnMap,true,LandView

clearFromMap

clearfrommap,datasetName

reset

poly

poly,true|false,color,thickness, dataSetName
//first param is autozoom

resize

resize,X,Y

Will resize the map. Not needed in the latest version as the map will resize itself based on document view size changes.

openInfo

openinfo,namePoint

Open the info bubble on the specified point and display the description param in it.

centerzoom

centerzoom,lat,lng,zoom

Will center the map on the specified coordinates and set the zoom level. If zoom is < 0 it will be left unchanged.

putlabels

putlabels,dataset

Show labels under the dataset points. The label is the point name.

removelabels

removelabels,{dataset}

setLabels,[ON|OFF]

newpolygon

newpolygon,tempName[,fillColor,fillOpacity,borderColor,borderOpacity,borderWidth]

Examples:

    newpolygon,Geofence,#EFED4F,0.3,#61C1A3,0.7,4	

Starts the creation of a new polygon on the map.

setPolygon

setpolygon,name,fillColor,fillOpacity,borderColor,borderOpacity,borderWidth,lat1,lng1,lat2,lng2,lat3,lng3...

Examples:

    setpolygon,Geofence,#EFED4F,0.3,#61C1A3,0.7,4,44.41844,26.08446,44.41697,26.084,44.41804,26.08899,44.42013,26.08771

updatePolygonStyle

updatePolygonStyle,name,fillColor,fillOpacity,borderColor,borderOpacity,borderWidth

getPolygon

getpolygon,name[|'ALL']

Will return the polygons in the following format

 [name1,color1,l1,long1,l2,long2,...][name2,color2,l21,lg21,...]

The return value is written in a div with id response_string and the location.href is set to app://polygon/response_string.

deletePolygon

deletepolygon,name[|'ALL']

startEditPolygon

startEditPolygon,name

endEditPolygon

endeditpolygon

Only one polygon can be edited at a time.

Polygon frequent commands

for creating a new polygons
        -- new polygon, name, color
        -- then when user press save getPolygon,name
        -- if  cancel deletePolygon,name
for canceling an edit
    -- deletePolygon, xx
    -- setPolygon, xx, ...
for canceling the creation of a new polygon
      -- deletePolygon, tempName
to update a polygon
    -- deletePolygon,name
    -- setPolygon,newName,{new settings}

getMapType

getmaptype

Will return [map|satellite|hybrid]. This is only for Google Maps. For OSM there is only one map type.

setMapType

setMapType,[map|satellite|hybrid]

Only works for Google Maps.

showconsole

showconsole,true|false

Used to show the console inside the map in an overlay div. Examples:

showconsole,true
showconsole,false

setLegacyIcons

added May 5, 2015

setLegacyIcons,true|false

When set, the labels and icon alignment will be adapted to work with older icons from images folder. Set it to false to use the icons in new cars and places folders.

not used anymore

  • getAddress,id,lat,longc
  • getLocation,addressString
  • clearResponse

How tos for SDMaps project

To compile

  • checkout the project from SVN
  • cd {co_directory}
  • install node if you haven't already
  • npm install
  • npm install grunt-cli -g
  • npm install -g grunt [windows]
  • npm install [windows]
  • to see the available tasks grunt -h
  • the project can compile an OSM version and a GOOGLE version like so
    • to compile for osm use grunt osm
    • to compile a version for goole use grunt google

The compiled application ready for distribution will be in dest directory.

The map should be uploaded using ftp on portal.safemobile.com on /upload/safenet/map.

To debug

  1. get the commands from SafeDispatch
  2. add them to TestCommands file in an array and modify the test() function so that the messages variable refers to the array with the commands
  3. start the application from SfmbMaps...html from the parent directory(not from dest)
  4. you should start a server in the project directory for easier debugging http-server .
  5. open a the console in the browser and look for errors
  6. to display the console inside the map add showconsole,true as the first command in the array of commands

To do 4 september 2015

  • color label based on icon color
  • fix geofences extra properties
  • make info bubble sit still if the user interacts with the buttons and the unit position changes
  • change the date formatted next to the ago indicator in info bubble

Issues on March 14, 2016

  • the text message is not cleared if you close the InfoWindow before sending it then open it for another unit
  • when being added to the dataset, a new unit (which was not previously in the dataset) can't open a InfoWindow