An additional image displayed when the user’s location is above the currently displayed level.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.aboveImage = 'marker-location-down.png';
How accurate the system (GPS) location must be before it will be displayed and used by the map, in metres.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.accuracy = 10;
The alpha transparency of the Component. Range from 0 to 100.
The image used to display a location that is detected using BLE beacons.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.beaconImage = 'marker-location.png';
An additional image displayed when the user’s location is below the currently displayed level.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.belowImage = 'marker-location-up.png';
Clip the components contents using one of the options in ClippingType.
Access this Component's sub-components.
Parameters for a custom feed (defined in JavaScript).
var mapComp = uComps.cast.toOfflineMap(comp);
var currentParameters = mapComp.customFeedParameters;
Url of feed data from website or Umajin Cloud.
var mapComp = uComps.cast.toOfflineMap(comp);
var currentUrl = mapComp.dataUrl;
This image is placed over top of the location image, and rotated to match the compass heading of the phone.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.directionIndicator = 'marker-arrow.png';
When true, a centred cross hair is placed over the map so you can be sure where the map is centred.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.displayCrosshair = true;
If true, a text title will be displayed next to each POI.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.displayPoiTitle = true;
Draws the data used for route finding over top of the tiles. This allows you to visually confirm the correct data is available.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.displayRouteMap = true;
Id of the Umajin Cloud feed.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.feedId = 14725;
Whether or not is component is enabled for the parent form. Only relevant when inside a Form Component.
Label used to identify the field this Component belongs to in a form. Only relevant when inside a Form Component.
The height of the Component.
Find if there is a beacon that is currently active.
var mapComp = uComps.cast.toOfflineMap(comp);
var beaconActive = mapComp.isBeaconActive;
Find if the current location of the user is know.
var mapComp = uComps.cast.toOfflineMap(comp);
var locationKnown = mapComp.isLocationKnown;
Find if the app is currently navigating through a route.
var mapComp = uComps.cast.toOfflineMap(comp);
var activeNavigation = mapComp.isNavigationActive;
Find if there is a route currently active.
var mapComp = uComps.cast.toOfflineMap(comp);
var activeRoute = mapComp.isRouteActive;
When true, the map can not be scrolled outside the bounds as defined by the tiles.json file.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.limitDisplay = true;
The length of time, in seconds, the last location will stay visible, if beacon or GPS location dissappears. Range 1 to 60. Default is 10.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.lingerTime = 10;
The various location images will be scaled to this physical size, allowing them to adjust to different device resolutions. Range 2 to 20. Default is 5.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.locationSize = 5;
The image used to display a location set using the Set Manual Location on Map action.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.manualImage = 'marker-location.png';
Location of the map tile images.Tile images should be in numbered folders.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.mapTilesDefinition = 'Umajin/metadata.json'
When markers are set, their images will be scaled to this physical size, allowing them to adjust to different device resolutions. Range 2 to 20. Default is 5.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.markerSize = 8;
Shape component to be used as a mask. Can be either a Rectangle or Circle Component.
Name of the component.
Access this Component's parent component.
Whether or not the Component has passed form validation. Only relevant when inside a Form Component.
Selects if the POI image will be positioned with the location at the bottom center (in the style of a pin in the map) or centered on the location.. uComps.PoiAlignment: 1 - CENTER, 2 - CENTER_BOTTOM
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.poiAlignment = uComps.PoiAlignment.CENTER;
Color for the POI text as a hexadecimal value. The alpha channel will be added, if not included.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.poiFontColor = '#631B1B';
The font file to use for the POI text.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.poiFontFilename = 'vera.ttf';
The font size for the POI text.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.poiFontSize = 8;
The distance between text characters. Range -5 to 10. Default is 0.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.poiFontTracking = 0.5;
Defines the width to display POI images, in millimetres. Range 2 to 20. Default is 5.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.poiSize = 4;
Defines the color of the line drawn to show a route, once found.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.routeLineColor = '#f6a950';
The width in pixels of the route line. Range 1 to 50. Default is 5.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.routeLineColor = 6;
The .OSM file containing the data to be used for finding routes on the map.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.routingDataFile = 'Umajin/umajin.osm'
for Routing After trying to find a route, this will show a marker at every node (point) on the route map that was checked in the search. This allows you to find gaps in paths, by looking for nodes that are not marked when it seems they should be.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.showVisitedNodes = true;
The minimum signal level to consider the beacon “close” enough to define location. Range -120 to 0. Default is -80.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.signalThreshold = -50;
The image used to display System (GPS) location, if enabled.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.systemImage = 'marker-location.png';
Type of the component.
Unique ID of the component.
This image is displayed if the beacon is not showing a close image, and has not been visited before.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.unvisitedImage = 'unvisited.png';
When true, location from GPS/wifi/cellular is displayed on the map.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.useSystemLocation = true;
Whether or not the Component is visible.
This image is displayed if the beacon is not showing a close image, and has been visited before.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.visitedImage = 'visited.png';
The width of the Component.
The x position of the Component relative to its parent.
The y position of the Component relative to its parent.
Places a named map marker at a latitude and longitude. This marker will remain on the map until cleared. If there is an existing marker with the same name it will be replaced.
Name used to identify the marker.
Positionn of marker.
Positionn of marker.
Marker image to use.
Title to display for the marker.
Description of the marker.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.addMapMarker('City Center', -40.35595165, 175.61109933, 'pointer.png', 'The Square', 'Te Marae o Hine is a large open space at the center of Palmerston North');
Finds a route between two (latitude, longitude) points. It will first find the nearest points on a path on the route map, and then find a route between the two points. To find a route from the user’s current location, leave the start latitude and longitude blank.
start position.
start position.
name of level for start position.
end position.
end position.
name of level for end position.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.addMapRouteByLatLong(-40.3387903838, 175.620532865, 'G', -40.338455091, 175.618837709, 'G')
This moves the map so that the user’s current location is centered.
When true, the map will move as the user moves, to keep centered on their location.
When true, map will be zoomed to the level defined by zoomLevel.
number to define zoom level. Range 1 to 25.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.centreMapOnUserLocation(true, true, 19);
Clears all map markers.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.clearAllMarkers();
Clears a manually set user location. The map will go back to showing location by beacons, GPS etc as applicable.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.clearManualLocation()
Clears a map marker with the given name.
Name used to identify the marker.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.clearMapMarker('City Center');
Clears the currently displayed route.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.clearMapRoute();
Call each callback that is registered for the given eventType
, in the order they were registered, passing the supplied data
to each.
The type of the event to emit.
Data object to pass to each callback.
This makes the map behave as if a specified Beacon ID is nearby. This helps you test beacon behaviours, especially on the desktop when designing the app.
name of beacon.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.fakeBeaconClose('Reception Area')
Set the keyboard focus to this component.
new uActions.Action('set focus', setFocus)
.addParameter('text entry',uActions.ParamType.TEXT_ENTRY)
.register();
function setFocus(textEntry) {
textEntry.focus();
}
Get a property by name.
var uActions = require('u-actions');
new uActions.Action('get fontsize',getFontSize).register();
function getFontSize() {
var text1=uPages.current.components.getText('Text 1');
console.log(text1.get('font_size'));
}
The name of the property to get.
Returned value can be of any type, or even null.
Starts turn-by-turn directions for the current route.
Message displayed if Bluetooth is currently disabled.
Message displayed if location is unknown.
Message displayed when location is known, but has not yet reached the route.
When true, map will be zoomed to the start of the route.
number to define zoom level. Range 1 to 25.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.mapStartNavigation("To receive directions, please switch Bluetooth on", "Directions will be available when we detect your location", "Please make your way to the Reception", true, 21);
Stops turn-by-turn directions.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.mapStopNavigation();
Adds the callback
function to the end of the listeners array for eventType
.
The type of the event.
The callback function
Refresh this component to force it to be re-rendered, or for its dynamic data to be updated.
Set a properties value by name.
var uActions = require('u-actions');
new uActions.Action('set text color',setTextColor).register();
function setTextColor() {
uPages.get('follow').components.getText('Text 1').set('font_color','0x0000FFFF');
}
The name of the property to set.
The value to set. Can be of any type.
Set a number properties at once.
Data object containing property name and value pairs to set on this component.
Sets the map to show a fixed location. The image is changed to that set by the manualImage property.
position for the map to center on.
position for the map to center on.
name of a level found in levels.txt.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.setManualLocation(15)
Positions the map to be centred on the specified latitude and longitude and on the specified level. Note that if latitude, longitude and level are blank then the map will be centered on the current user location (if known), same as the centreMapOnUserLocation action.
position for the map to center on.
position for the map to center on.
name of a level found in levels.txt.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.setMapCenterLocation(-43.5309385, 172.6338719, '2')
Turns display of diagnostics on the map on and off. Useful for debugging issues.
When true, diagnostic information becomes visible on the screen.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.setMapDiagnostics(true);
Allows you to control whether the map will use GPS (system) location while running. This can be useful to switch between indoor and outdoor operation.
When true, use the system (GPS) location while running.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.setMapGps(true);
Changes the level (floor) of the map that is being viewed. Options allow you to set a specific floor or go up or down. This may have no effect if already at top or bottom, or you specify a level that doesn’t exist in levels.txt.
'up', 'down', or 'set', if a levelName is also defined.
name of a level found in levels.txt.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.setMapLevel('set','Top Floor')
Zooms the map to a specified level. Note that the map tiles will only support a certain range.
number to define zoom level. Range 1 to 25.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.setMapZoomLevel(15)
Tween a component property over time.
The number of seconds to tween for.
An objects that contains key/value pairs of the properties and values to tween.
(Optional) Tween type can be any type from "Tween.type"
Triggers the current direction again. This can be useful to update the display when something else may have changed.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.updateMapDirections();
Zooms and pans the map to fit two specified coordinates in a defined area.
First coordinate of defined area.
First coordinate of defined area.
Second coordinate of defined area.
Second coordinate of defined area.
var mapComp = uComps.cast.toOfflineMap(comp);
mapComp.zoomMapToFitPoints(-40.35508262, 175.603959,-40.35757633, 175.6178425);
Zooms and pans the map to show the current route in a defined area. To define the area, create any component such as a rectangle and make it invisible or behind the map. This allows an area of the screen to be selected, which is used to show the route.
component to define the area for the map to move to.
var mapComp = uComps.cast.toOfflineMap(comp);
var rectComp = uComps.cast.toRectangle(comp2);
mapComp.zoomMapToRoute(rectComp);
The Offline Map component allows you to show a map in your Project that does not require any internet connection. The map is typically of a small area to reduce project size.