0.1.3 • Published 4 years ago

leaflet-logo-plugin v0.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

leaflet-logo

A useful control to logo with many options for page.

Basic Usage

Set up:

  1. Get CSS and JavaScript files
  2. Include CSS and JavaScript files
  3. Initialize plugin

Add the JavaScript and CSS files

This example shows how to include the logo control files directly from github. In production, prefer using npm.

<link rel="stylesheet" href="https://github.com/barisariburnu/leaflet-logo/blob/master/dist/leaflet-logo.min.css" />

<script src="https://github.com/barisariburnu/leaflet-logo/blob/master/dist/leaflet-logo.min.js" charset="utf-8"></script>

Add the following snippet to your map initialization:

This snippet adds the control to the map. You can pass also pass a configuration.

L.control.logo({
    link: 'Redirect Url',
    image: 'Image Url'
}).addTo(map);

Possible options

The logo controls inherits options from Leaflet Controls.

To customize the control, pass an object with your custom options to the logo control.

L.control.logo(OPTIONS).addTo(map);

Possible options are listed in the following table. More details are in the code.

OptionTypeDefault
positionstringtopleft
heightstring50px
widthstring50px
targetstring50px
linkstringNone (required)
imagestringNone (required)

For example, to customize the position, link and image, you could write

var lc = L.control.logo({
    position: 'topleft',
    link: '#',
    image: 'https://avatars3.githubusercontent.com/u/7146753?v=3&s=100'
}).addTo(map);

License

MIT

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago