marker
Overview
A marker
can visually highlight a specific location on a map within either the capture-coordinates
or display-coordinates
UI component.
Example - Binding Multiple Markers
Below is an example of using capture-coordinates
along with multiple custom markers.

<var name="current_location" type="location" />
<var name="map_center" type="location" />
<var name="high_school" type="location" />
<var name="food" type="location" />
<capture-coordinates label="My Location" bind="current_location" allow-zoom="true" allow-dragging="true" >
<marker bind="map_center" icon="fa-user"/>
<marker bind="high_school" icon="fa-graduation-cap" />
<marker bind="food" icon="fa-utensils" />
</capture-coordinates>
function init() {
view.map_center = new Location({
latitude: 39.7562259,
longitude: -105.0094353
});
view.high_school = new Location({
latitude: 39.7553694,
longitude: -105.0195773
});
view.food = new Location({
latitude: 39.7497094,
longitude: -105.0053815
});
}
Standard Attributes
bind
bindbind
label
label
Optional
Type: string
(static text, a format string or the return value of a JS/TS function)
Default: unset
Text to display above the marker in a floating bubble. Text is displayed once a user interacts with the marker.
View XML using marker
:
<var name="current_location" type="location" />
<var name="marker" type="location" />
<capture-coordinates bind="current_location">
<marker latitude="{marker.latitude}" longitude="{marker.longitude}" label="This is an example label" />
</capture-coordinates>
View JS using marker
:
function init() {
// Example marker
view.marker = new Location({
latitude: 39.7553694,
longitude: -105.0195773
});
}
View XML using marker-query
:
<var name="current_location" type="location" />
<var name="markers" type="array:custom_marker" />
<capture-coordinates bind="current_location">
<marker-query query="markers" latitude="{location.latitude}" longitude="{location.longitude}" label="This is an example label" />
</capture-coordinates>
View JS using marker-query
:
function init() {
view.markers = DB.custom_marker.where('location != ?', null).toArray();
}
Also see:
labellatitude
and longitude
latitude
and longitude
Optional
Type: location
Default: unset
Specifies at which latitude and longitude the marker will be positioned on the map. Use latitude
and longitude
from the location
variable/field to specify the marker location.
View XML using marker
:
<var name="current_location" type="location" />
<var name="marker" type="location" />
<capture-coordinates bind="current_location">
<marker latitude="{marker.latitude}" longitude="{marker.longitude}" />
</capture-coordinates>
View JS using marker
:
function init() {
// Example marker
view.marker = new Location({
latitude: 39.7553694,
longitude: -105.0195773
});
}
View XML using marker-query
:
<var name="current_location" type="location" />
<var name="markers" type="array:custom_marker" />
<capture-coordinates bind="current_location">
<marker-query query="markers" latitude="{location.latitude}" longitude="{location.longitude}" />
</capture-coordinates>
View JS using marker-query
:
function init() {
view.markers = DB.custom_marker.where('location != ?', null).toArray();
}
Advanced Attributes
color
color
Optional
Type: string
- can be a named color or #HEX value
Default: unset
Specify the color of the marker background.
View XML using marker
:
<var name="current_location" type="location" />
<var name="marker" type="location" />
<capture-coordinates bind="current_location">
<marker latitude="{marker.latitude}" longitude="{marker.longitude}" color="#000" />
</capture-coordinates>
View JS using marker
:
function init() {
// Example marker
view.marker = new Location({
latitude: 39.7553694,
longitude: -105.0195773
});
}
View XML using marker-query
:
<var name="current_location" type="location" />
<var name="markers" type="array:custom_marker" />
<capture-coordinates bind="current_location">
<marker-query query="markers" latitude="{location.latitude}" longitude="{location.longitude}" color="#000" />
</capture-coordinates>
View JS using marker-query
:
function init() {
view.markers = DB.custom_marker.where('location != ?', null).toArray();
}
icon
icon
Optional
Type: string
Default: fa-circle
Specify the icon shown in the marker. Find a list of available icons here.
View XML using marker
:
<var name="current_location" type="location" />
<var name="marker" type="location" />
<capture-coordinates bind="current_location">
<marker latitude="{marker.latitude}" longitude="{marker.longitude}" icon="fa-star" />
</capture-coordinates>
View JS using marker
:
function init() {
// Example marker
view.marker = new Location({
latitude: 39.7553694,
longitude: -105.0195773
});
}
View XML using marker-query
:
<var name="current_location" type="location" />
<var name="markers" type="array:custom_marker" />
<capture-coordinates bind="current_location">
<marker-query query="markers" latitude="{location.latitude}" longitude="{location.longitude}" icon="fa-star" />
</capture-coordinates>
View JS using marker-query
:
function init() {
view.markers = DB.custom_marker.where('location != ?', null).toArray();
}
icon-color
icon-color
Optional
Type: string
- can be a named color or #HEX value
Default: unset
Specify the color of the icon
.
View XML using marker
:
<var name="current_location" type="location" />
<var name="marker" type="location" />
<capture-coordinates bind="current_location">
<marker latitude="{marker.latitude}" longitude="{marker.longitude}" icon="fa-star" icon-color="#000" />
</capture-coordinates>
View JS using marker
:
function init() {
// Example marker
view.marker = new Location({
latitude: 39.7553694,
longitude: -105.0195773
});
}
View XML using marker-query
:
<var name="current_location" type="location" />
<var name="markers" type="array:custom_marker" />
<capture-coordinates bind="current_location">
<marker-query query="markers" latitude="{location.latitude}" longitude="{location.longitude}" icon="fa-star" icon-color="#000" />
</capture-coordinates>
View JS using marker-query
:
function init() {
view.markers = DB.custom_marker.where('location != ?', null).toArray();
}
on-press
on-presson-press
show-if
and hide-if
show-ifhide-ifshow-if
and hide-if
Last updated