0.0.8 • Published 5 years ago

leaflet-center-cross v0.0.8

Weekly downloads
72
License
BSD-2-Clause
Repository
github
Last release
5 years ago

Leaflet.CenterCross

Leaflet.CenterCross, a plugin that adds cross image on center to Leaflet powered maps.

Original program is developed by Geospatial Information Authority of Japan.

https://github.com/gsi-cyberjapan/gsimaps

Structure and build scripts are based Leaflet.draw.

https://github.com/Leaflet/Leaflet.draw

How to use

include javascript.

<script src="https://unpkg.com/leaflet-center-cross@0.0.8/dist/leaflet.CenterCross.js"></script>

add follow code:

var control = L.control.centerCross();
map.addControl(control);

Control.centerCross

CenterCross control provides toggle switch of center cross.

var control = L.control.centerCross({show: true, position: "topright"});
map.addControl(control);

Creation

FactoryDescription
L.control.centerCross(<Control.CenterCross options> options?)Create a center cross control.

Options

OptionTypeDefaultDescription
positionString'topleftSee [Control Positions](http://leafletjs.com/reference.html#control-positions)
toggleTextString'C'control's text
toggleTitleString'Toggle Center Cross'control's title, show on mouse over in control like tooltip
showBooleanfalseIf true, show center cross when addControl

centerCross

Used to put center cross object in center of the map.

var centerCross = L.centerCross();
map.addLayer(centerCross);

Creation

FactoryDescription
L.centerCross(<[CenterCross options](#centercross_options)> options?)Creates a center cross object.

Options

OptionTypeDefaultDescription
visibleBooleantrueIf true, adds center cross to the map.

Methods

MethodReturnsDescription
addTo(<[Map ](http://leafletjs.com/reference.html#map-class)> map)thisAdds center cross to the map.
getVisible()BooleanReterns true if center cross shows in the map.
setVisible(< Boolean > on)thisUpdates visible status
0.0.8

5 years ago

0.0.7

5 years ago

0.0.3

5 years ago