Naboo's Podracing Misadventure

    leaflet-center-cross

    0.0.8 • Public • Published

    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

    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

    Install

    npm i leaflet-center-cross

    DownloadsWeekly Downloads

    38

    Version

    0.0.8

    License

    BSD-2-Clause

    Unpacked Size

    23.6 kB

    Total Files

    16

    Last publish

    Collaborators

    • smellman