Skip to main content

dg-entrance

Allows to display an entrance to the building. The class supports simple animation and multiple inputs display. Objects of entrances themselves represent arrows which change their scale together with zooming, but not lower than the level 16, after which the arrows disappear from the map (until reaching an acceptable level of zooming).

DG.Entrance

Example of usage

Create and display the entrances to the building:

var options = {
vectors: [
'LINESTRING(82.897079 54.980906,82.897191 54.980844)',
'LINESTRING(82.897933 54.980649,82.898045 54.980587)',
'LINESTRING(82.897071 54.980122,82.897226 54.98013)',
'LINESTRING(82.897354 54.979515,82.89741 54.979599)',
'LINESTRING(82.898498 54.979826,82.898386 54.979889)',
],
};
DG.entrance(options).addTo(map).show(true);

Creation

FactoryUsageDescription
DG.Entrance( <Entrance options> options ) DG.entrance(…)Creates an entrance object based on the provided options.

Options

OptionTypeDefaultDescription
vectorsArray[](a required parameter)An array of vectors describing the entrances to the building. You can send several values in the array, if there is more than one entrance to the building. Each element should represent a string in WKT format: LINESTRING(lng0 lat0,lng1 lat1[,... lngN latN]), where the last coordinate pair should be a direct entrance point to the building, and the previous coordinates - be the route to this point. Throughout the route there should not be mutual intersections.
fillColorString#0085a0The fill color of the arrows.
strokeColorString#ffffffThe outline color of the arrows.
enableAnimationBooleantrueWhether to animate the display of arrows when you change the zoom levels of the map and during the initial display.
interactiveBooleanfalseIf the value is false, then the handler of the mouse actions is not called.
autoCloseBooleantrueWhether to remove objects of entrances after adding new layers to the map.

Methods

MethodReturnsDescription
addTo( <Map> map ) thisAdds the object of entrances to the map.
removeFrom( <Map> map ) thisRemoves the object of entrances from the map.
show( <fitBounds> boolean ) thisDisplays entrances on the map. If fitBounds is set to true, then the map boundaries (and zoom level) are adjusted so that the user could see all the entrances on one screen.
hide()thisHides entrances. The objects themselves are not deleted from the map and the entrances can be re-displayed by calling the show() method.
isShown()BooleanReturns true if the entrances are currently displayed on the map.
setFillColor()StringChanges the fill color of the arrows.
setStrokeColor()StringChanges the outline color of the arrows.