Draws a polyline on the map
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.draw.line([[-104.984855, 39.738452], [-105.279266, 40.01583]], 'red', 4);
map.fitBounds();
});
An array of lng,lat arrays.
[[-104.984855, 39.738452], [-105.279266, 40.01583]]
rgb, hex, or color name for the line.
An interger value for the thickness of the line (1 is thinnest).
The DOM ID assigned to the line.
Draws a polygon on the map
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.draw.polygon([[-104.984855, 39.738452], [-105.279266, 40.01583], [-105.084419, 40.585258], [-104.984855, 39.738452]], 'red', 0.8);
map.fitBounds();
});
An array of lng,lat arrays.
[[-104.984855, 39.738452], [-105.279266, 40.01583]]
rgb, hex, or color name for the polygon.
The opacity of the fill. Range 0 - 1: 1 = opaque, 0 = transparent.
The DOM ID assigned to the polygon.
Draws a circle on the map
var map = new mqgl.Map('map', 'KEY');
map.load( () => {
map.draw.circle([-104.984855, 39.738452], 6, 'red', 0.8);
map.fitBounds();
});
The center of the circle.
[-104.984855, 39.738452]
The km radius of the circle.
rgb, hex, or color name for the circle.
The opacity of the fill. Range 0 - 1: 1 = opaque, 0 = transparent.
The DOM ID assigned to the circle.