Viz World User Guide
Version 17.0 | Published January 24, 2018 ©
NavCom
    
    
The plugin can be found in the folder: Viz Artist 3: Built Ins -> Container Plugins -> Maps-Adv.    
The NavCom plugin is used for controlling the Navigator plugin. The plugin is an example showing how to externally control the Navigator plugin when special applications should be used to control the scene. An example for a special case where external control of the Navigator plugin is required is Elections. When using Viz 3.x scripting, complicated logics and commands can be used with the NavCom plugin.
This section contains information on the following tabs and examples:
Commands
The Commands tab is used for communicating with the Navigator plugin in means of sending formatted commands and receiving formatted responses from the Navigator plugin:
    
    
The Command text field is where you enter the command. The NavCom plugin receives predefined, fixed syntax, commands and returns a reply from the Navigator plugin.    
The Response field contains the reply returned from the Navigator plugin. The format of the reply is defined in the Advanced tab.
The Immediate Response option defines whether the command will be sent while typing (every change to the command field will sent the command to Navigator), or only after pressing the Execute Command button.
The following is a list of commands, example commands and return values:
Mouse To Lon Lat: Converts screen coordinates to Long/Lat values from the map. This needs the Navigator plugin.
-     
Command: MTLL x y
 -     
Response: lon lat
MTLL360288-116.99838.088Mouse To Region: Returns the region name in which the given screen coordinates reside. This command requires the Navigator plugin.
 
-     
Command: MTR x y
 -     
Response: CountryID "Country Name" RegionID "Region Name" SubRegionID "Sub Region Name"
MTR3602881000000000003600"United States of America"1000000000038901"Texas"1000000000111302"Atascosa County"All Fly To commands require the Navigator and the NavFinder plugin. Also set the Navigator plugin’s Interactive Anim setting to On.
 
Fly To Region ID: Triggers a Navigator animation from the current location to the sent region (RegionID).
-     
Command: FTRID RegionID
FTRID 81000000000F8285Fly To Country: Triggers a Navigator animation from the current location to the sent country (country name).
 
-     
Command: FTC "country name"
FTC"united states of America"Fly To Region: Triggers a Navigator animation from the current location to the sent region (Region name).
 
-     
Command: FTR "country" "Region"
FTR"united states of America""Texas"Fly To Sub Region: Triggers a Navigator animation from the current location to the sent sub region (by name).
 
-     
Command: FTSR "country" "Region" "Sub Region"
FTSR"united states of America""Texas""young county"Fly To Lon Lat Level: Triggers a Navigator animation from the current location to the sent level area (country, region, or sub region) that the long/lat data resides in.
 
-     
Command: FTLLL lon lat level
FTLLL -116.99838.0881Note: Levels are: 0 = Country, 1 = Region, 2 = Sub Region
Search database: Searches the map database and as a response generates an XML. This command requires a running Viz World server.
 
-     
Command: SMDB <query>
Search web: Searches the web and as a response generates an XML. This command requires a running Viz World server. 
-     
Command: SWEB <query>
Search All: Searches both resources (map database and web) and as a response generates an XML. This command requires a running Viz World server. 
-     
Command: SALL <query>
 -     
Shared memory reply: WS_REPLY
Nearby: Searches locations in the vicinity of the coordinates of your “mouse” and as a response generates an XML. This command requires a running Viz World server. This command requires the Navigator plugin. 
-     
Command: NEARBY [mouse-x] [mouse-y]
 -     
Shared memory reply: NAV_NEARBY_REPLY
Shared Navigation memory of the Navigator plugin can be activated by setting Publish Geo Data to Bounding box or Location. If Bounding box is selected you will, in addition to Bounding box data, get Center and Distance data. If Location is selected you will, in addition to the Location data, get all the others. If None is selected no data is shared. 
All can be used with scripting to define e.g. the administration levels the script should fetch from the shared data and consequently display it on screen. For interactive scenes such as touch screens this can be used for adding graphics to maps based on your selection (thereby avoiding over-populating the map with information).
For testing you can enable the interactive mode by clicking the E button in Viz Artist’s Scene Editor.
Navigation location: Shared data holding the current geographic location(s) of the Navigator plugin. To enable it, select Publish Geo Data’s Location option. The data is updated when the camera is not moving. Navigation location also generates an XML with the current geographic location(s) (in the same format as SMDB, SWEB, SALL and NEARBY). This requires a running Viz World Server.
-     
Name: NAV_LOCATION_DATA
Navigation bounding box: Shared memory data holding the current (frame by frame) geographic bounding box (lat lon) of the Navigator plugin. To enable it, select Publish Geo Data’s Bounding box or Location option. 
-     
Reply: NAV_BB_DATA
Navigation center: Shared memory data holding the current (frame by frame) geographic center of the Navigator plugin. To enable it, select Publish Geo Data’s Bounding box or Location option. 
-     
Reply: NAV_CENTER_DATA
Navigation distance: Shared memory with the current distance to world of the Navigator plugin. To enable it, select Publish Geo Data’s Bounding box or Location option. 
-     
Reply: NAV_DISTANCE_DATA
Navigation direction: Shared memory with the current pan and tilt direction of the Navigator plugin. To enable it, select Publish Geo Data’s Bounding box or Location option. 
-     
Reply: NAV_DIRECTION_DATA
 
Control
The Control tab is used to directly control the Navigator plugin by changing the values of the parameters
    
        
-     
Lon: Sets the longitude value for the Navigator plugin. The Navigator camera will move to the specified longitude value.
 -     
Lat: Sets the latitude value for the Navigator plugin. The Navigator camera will move to the specified latitude value.
 -     
Distance: Sets the Navigator distance from the map. The Navigator camera will move to the specified distance value.
 -     
Pan: Sets the pan value of the Navigator camera.
 -     
Tilt: Sets the tilt value of the Navigator camera.
 -     
Interactive Mode: Defines the interactive behavior of Viz. Available modes are None, Editor, On-Air, Always.
-     
None: Disables interactive mode.
 -     
Editor: Enables interactive mode during scene editing.
 -     
On-Air: Enables interactive mode when Viz Engine is in On Air mode.
 -     
Always: Enables interactive mode during scene editing and when Viz Engine is in On Air mode.
 
 -     
 -     
Minimal Distance: Sets the minimal distance from the map in Viz units.
 -     
Zoom Center: Used in interactive mode.
-     
Position: The map zooms to center on the position of the fingers.
 -     
Center: The map zooms to the center of the map.
 
 -     
 -     
Momentum Mode: When set to Linear you can set how much friction should be applied to the momentum.
Note: The Navigator control parameters effect the Navigator immediately.
 
Advanced
The Advanced tab is used for defining the NavCom plugin’s general behavior patterns.
    
        
-     
Shape File Support: Defines whether the NavCom plugin will include shape objects information in the respond. The Shape objects must reside under the NavCom container. When the Shape File Support is Limited, the plugin will scan the shape files below the container. When a command is received, the NavCom plugin will return, in the response string, information about the shapes that overlap the requested data in the command. When the Shape File Support is Only, the plugin will scan the shape files below the container. When a command is received, the NavCom plugin will return, in the response string, only the information about the shapes that overlap the requested data in the command.
 -     
Limit Picking: Limits the geographical area that the NavCom plugin will perform any of the commands on. When Limit Picking is enabled the Limit to Country parameter will be enabled.
-     
Limit to Country: Sets the country name. If the requested data in the command does not exist for the defined country area, the command will not be executed. Only commands relating to points within the country area will be executed.
 
 -     
 -     
Shared Memory Prefix: This parameter should be used when using more than one NavCom plugin in the scene, and when using scripting to send and receive information from these plugins. In each NavCom plugin, set the Shared Memory Prefix to a different prefix (up to four) to distinguish between the data sent to each plugin.
 -     
Protocol Mode: Defines the data displayed in the Response field.
-     
Full: Includes data on names and IDs for countries, regions and sub-regions.
 -     
Name: Includes data on names for the countries, regions and sub-regions.
 -     
ID: Includes only ID data (as defined in the Viz World Server) for the countries, regions and sub-regions.
 
 -     
 -     
Protocol Separator: Defines the separating character between the Response data. The defined separator will be used between country and region, region and sub-region, and so on.
 -     
Use Quotes: Defines whether the response string will be quoted or not.
 -     
Suffix FIPS: Used for USA regions and sub-regions.
 -     
Publish Geo Date: Allows you to publish navigation data to shared memory based on your interaction with the graphics scene (e.g. touchscreen or mouse). Shared Navigationmemory can be activated by setting Publish Geo Data to Bounding box or Location. If Bounding box is selected you will, in addition to Bounding box data, get Center and Distance data. If Location is selected you will, in addition to the Location data, get all the others. If None is selected no data is shared. See the available Navigation data under the Commands section.
 -     
Execute Command: When pressed, the defined command will be executed.
 -     
Initialize: This button is used when using shape file support. If the shape objects under the NavCom container is changed, press the initialize button to re-scan the shape objects.
 
NavCom Scripting
Viz 3.X scripting ability is a powerful tool for implementing complex logic into a scene. In a Navigator scene, NavCom can be used in the scripts to enable such advanced Navigator operations. The following script example demonstrates how to send and receive data from the Navigator plugin through to the NavCom plugin.
Example: Script example: main.txt
dim level as Integerdim ignore as Integerdim CurCountry as stringdim CurCountryId as stringdim CurState as stringdim CurStateId as stringdim CurCounty as stringdim CurCountyId as stringSub UpdateCurrent(temp As String)    dim position as Integer    dim temp2 as String    println temp    CurCountryId = temp.left(16)    position = temp.Find("\"")    temp = temp.GetSubstring(position+1,temp.Length-(position+1) )    temp2 = temp    position = temp2.Find("\"")    CurCountry = temp2.Left(position)    println "<" & CurCountryId & "><" & CurCountry & ">"    position = temp.Find("\"")    temp = temp.GetSubstring(position+2,temp.Length-(position+2) )    CurStateId = temp.left(16)    position = temp.Find("\"")    temp = temp.GetSubstring(position+1,temp.Length-(position+1) )    temp2 = temp    position = temp2.Find("\"")    CurState = temp2.Left(position)    println "<" & CurStateId & "><" & CurState & ">"     position = temp.Find("\"")    temp = temp.GetSubstring(position+2,temp.Length-(position+2) )    CurCountyId = temp.left(16)    position = temp.Find("\"")    temp = temp.GetSubstring(position+1,temp.Length-(position+1) )    temp2 = temp    position = temp2.Find("\"")    CurCounty = temp2.Left(position)    println "<" & CurCountyId & "><" & CurCounty & ">"End SubSub OnInit()    ignore = 0     level = 1     if Scene.Map.ContainsKey("MTR") = false Then        Scene.Map.CreateKey("MTR")    End If    if Scene.Map.ContainsKey("FTRID") = false Then        Scene.Map.CreateKey("FTRID")    End If    if Scene.Map.ContainsKey("FTC") = false Then        Scene.Map.CreateKey("FTC")    End If    if Scene.Map.ContainsKey("FTR") = false Then        Scene.Map.CreateKey("FTR")    End If    if Scene.Map.ContainsKey("FTSR") = false Then        Scene.Map.CreateKey("FTSR")    End If    if Scene.Map.ContainsKey("FTLLL") = false Then        Scene.Map.CreateKey("FTLLL")    End If    if Scene.Map.ContainsKey("MTR_REPLY") = false Then        Scene.Map.CreateKey("MTR_REPLY")    End If    if Scene.Map.ContainsKey("FTRID_REPLY") = false Then        Scene.Map.CreateKey("FTRID_REPLY")    End If    Scene.Map.RegisterChangedCallback("MTR_REPLY")    System.Map.RegisterChangedCallback("REGION_L") End SubSub OnSharedMemoryVariableChanged(map As SharedMemory, mapKey As String)     println mapKey    dim temp as String    If mapKey = "REGION_L" Then       println "ignore pre"       ignore = 1    else If mapKey = "MTR_REPLY" Then       temp = Scene.Map["MTR_REPLY"]       UpdateCurrent(temp)       println System.Map["REGION_L"]          if System.Map["REGION_L"] = "1" then          Scene.Map["FTRID"] = CurCountryId       elseif System.Map["REGION_L"] = "2" then          Scene.Map["FTRID"] = CurStateId       elseif System.Map["REGION_L"] = "3" then          Scene.Map["FTRID"] = CurCountyId       End If    End If    If mapKey = "MTLL_REPLY" Then        println    Scene.Map["MTLL_REPLY"]    End If End Subsub OnLButtonDown()    dim temp as String    if System.MouseX < (System.RenderWindowWidth: 120 ) then       Scene.Map["MTR"] = (String) System.MouseX & " " & (String)System.MouseY    end ifend sub