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).


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)"


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


Option Type Default Description
vectors Array [] (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.
fillColor String #0085a0 The fill color of the arrows.
strokeColor String #ffffff The outline color of the arrows.
enableAnimation Boolean true Whether to animate the display of arrows when you change the zoom levels of the map and during the initial display.
interactive Boolean false If the value is false, then the handler of the mouse actions is not called.
autoClose Boolean true Whether to remove objects of entrances after any actions with the card.


Method Returns Description
addTo( <Map> map ) this Adds the object of entrances to the map.
removeFrom( <Map> map ) this Removes the object of entrances from the map.
show( <fitBounds> boolean ) this Displays 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() this Hides entrances. The objects themselves are not deleted from the card and the entrances can be re-displayed by calling the show() method.
isShown() Boolean Returns true if the entrances are currently displayed on the map.
setFillColor() String Changes the fill color of the arrows.
setStrokeColor() String Changes the outline color of the arrows.