The icons object that interfaces with the Icons API. Used for adding customizable icons to a map.
Adds an icon to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.add({ lng: -104.999472, lat: 39.750307 }, 'marker-sm.png');
});
A lngLat object of the icon's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API resource for the icon.
A Promise, consisting of the created Icon object.
Adds a marker to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.marker.add({ lng: -104.999472, lat: 39.750307 }, 'blue-sm.png');
});
A lngLat object of the markers's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API options for the marker.
A Promise, consisting of the created Icon object.
Adds a circle to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.circle.add({ lng: -104.999472, lat: 39.750307 }, 'red-sm.png');
});
A lngLat object of the circle's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API options for the circle.
A Promise, consisting of the created Icon object.
Adds a via to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.via.add({ lng: -104.999472, lat: 39.750307 }, 'green-sm.png');
});
A lngLat object of the circle's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API options for the circle.
A Promise, consisting of the created Icon object.
Adds a flag to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.flag.add({ lng: -104.999472, lat: 39.750307 }, 'start-sm.png');
});
A lngLat object of the flag's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API options for the flag.
A Promise, consisting of the created Icon object.
Adds a construction to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.construction.add({ lng: -104.999472, lat: 39.750307 }, 'low-sm.png');
});
A lngLat object of the construction icon's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API options for the construction icon.
A Promise, consisting of the created Icon object.
Adds an incident icon to the map at the provided lngLat point customized by the slug. The slug may be any valid icon resource as documented in the Icons API.
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.icons.incident.add({ lng: -104.999472, lat: 39.750307 }, 'high-sm.png');
});
A lngLat object of the incident icon's location.
{
lng: -104.999472,
lat: 39.750307
}
The Icons API options for the incident icon.
A Promise, consisting of the created Icon object.