leaflet-center-cross
v0.0.8
Published
a plugin that adds cross image on center to Leaflet powered maps
Downloads
301
Readme
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/[email protected]/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
|Factory|Description| |-------|-----------| |L.control.centerCross(<Control.CenterCross options> options?)|Create a center cross control.|
Options
|Option|Type|Default|Description| |------|----|-------|-----------| |position|String|'topleft|See Control Positions| |toggleText|String|'C'|control's text| |toggleTitle|String|'Toggle Center Cross'|control's title, show on mouse over in control like tooltip| |show|Boolean|false|If 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
|Factory|Description| |-------|-----------| |L.centerCross(<CenterCross options> options?)|Creates a center cross object.|
Options
|Option|Type|Default|Description| |------|----|-------|-----------| |visible|Boolean|true|If true, adds center cross to the map.|
Methods
|Method|Returns|Description| |------|-------|-----------| |addTo(<Map > map)|this|Adds center cross to the map.| |getVisible()|Boolean|Reterns true if center cross shows in the map.| |setVisible(< Boolean > on)|this|Updates visible status|