Map Class Reference
Map.addItem(label, geo, onclick, style) Map.addUsers() | Map.setFloorPlan(fileid) Map.show() |
This class displays a zoomable map on the screen and adds clickable markers to it. All methods in this class are static. Typically you call Map.addItem() method followed by one Map.show(). Map and List class are mutually exclusive in a page
Map.addItem("San Fransisco", "37.769099,-122.425584", "viewCity()"); Map.addItem("Paris", "48.859875,2.347060", "viewCity()", "background-color:" + Color.RED); Map.addUsers(); // add the real-time position of all users on my account Map.show();
Map.addItem(label, geo, onclick, style)
Adds a clikable marker on the map.
- label (string) is the marker title
- geo (string) is the geo coordinate of the marker, in the format : lat,long. For example 1.02322,25.94956
- onclick (string) is the callback function to execute when the marker is tapped.
-
style (string, optional) contains the style of the marker in CSS format. "background-color" and "label" are the 2 supported properties
The following properties are supported
- on mobile : img, color, background-color, draggable
- on web: background-color, label (use label for a always displayed label next to the icon)
Map.addItem("Truck VBG23", "48.858238,2.347918", "viewTruck()", "label:Truck VBG23;background-color:" + Color.ORANGE);
On Web, use the style="label:My Label" value to add an always visible label next to the map icon
Map.addUsers()
adds the position of all other users in the current account to the map.
Map.addUsers();
Note : users need to have the Share Location settings checked on their phone in Upvise to be visible by other users.
Map.setFloorPlan(fileid)
Use the image identified by its fileid to be used as a background fllor plan instead of the earth map. In this case, the geo coorditnates units are expressed in pixel in the format: x,y for example 250,345. fileid is a upvise record id of an image uploaded in Upvise.
Map.show()
Displays the map on screen. This must be the call call on this class