AddBlockLocationView Class
_views\AddBlockLocationView.js:1
Add block view is a UI component which allows selection and insertion of a GPS location view coords
Constructor
AddBlockLocationView
()
Object
Returns:
instantiated AddBlockLocationView
Item Index
Methods
_clearMap
()
Clear the entire map of markers and circles by iterating over the m_mapPoints array
_createMap
()
Create the google map and listen to corresponding events such map clicks (not within a circle or marker) as well as the Search box find input etc
_goBack
()
Go back after selection
_initMap
()
Init the google map module. We also create a class for _mapPoint which when it gets instantiated internally holds a reference to it's own coordinates as well as Marker and Circle. Once we do a new on _mapPoint we insert it into an array of m_mapPoints so we can hold a reference to all points in a map (used for example when we want to clear the map so we can cycle through the points and remove them).
_listenModeChange
()
Listen to mode change between simulation mode and real mode
_listenStationRefresh
()
Listen stations refresh so we rebuild list of available station in the drop down selection
_loadStationList
()
Load and refresh the station list so we can pull station id for simulation
_pointData
()
Get all pointData (deprecated)
_render
()
Build lists of components, resources and scenes (respectively showing what's needed per placement mode) Once an LI is selected proper event fired to announce block is added.
Returns:
undefined
_simulateEvent
-
lat
-
lng
-
inRange
Simulate a trigger event of GPS coordinates by user clicks within the google map
Parameters:
-
lat
Number -
lng
Number -
inRange
Booleantrue if clicked within a marked circle radius
addPoint
-
latLng
-
radius
-
notCenter
Add a new point to the map (a point is constructed of marker and circle radius and inserted into m_mapPoints)
Parameters:
-
latLng
Number -
radius
Number -
notCenter
Boolean
initialize
()
Constructor
loadJson
()
Load and populate the map fro json data, keep in mind data needs to be available from previous method call fills up m_mapData
panToPoint
-
lat
-
lng
Animate google maps to give position
Parameters:
-
lat
Number -
lng
Number
selectView
-
i_mapData
-
i_markerOnClick
Select current view which will animate page loading
Parameters:
-
i_mapData
Objectload map data
-
i_markerOnClick
Booleanif true, we allow a single click to add a new marker in map
selectView
-
i_mapData
Set current map data (we dont actaully render it yet, just get it ready)
Parameters:
-
i_mapData
Objectload map data
selectView
()
Deselect current view which will animate page unloading