Coder Social home page Coder Social logo

beautifymarker's Introduction

BeautifyMarker

Leaflet.BeautifyIcon, a lightweight plugin that adds colorful iconic markers without images for Leaflet by giving full control of style to end user ( i.e. unlimited colors and many more...). It has also ability to adjust font awesome and glyphicon icons. Click here for Demo

Smiley face

JSFiddle Demo

JSFiddle Demo

Prerequisities

  • Font Awesome Icons 4.6.1
  • Latest Leaflet Library

Installing

Add files in following order

1- Font Awesome CSS
2- Bootstrap CSS
3- leaflet-beautify-marker-icon.css
4- leaflet-beautify-marker-icon.js

Usage

Create markers as usual with Leaflet with L.BeautifyIcon.icon using available options from below. Example:

options = {
    icon: 'leaf',
    iconShape: 'marker'
};
L.marker([48.13710, 11.57539], {
    icon: L.BeautifyIcon.icon(options),
    draggable: true
}).addTo(map).bindPopup("popup").bindPopup("This is a BeautifyMarker");

Properties

Property Description Type Default Possible
icon Name of icon you want to show on marker string leaf See glyphicons or font-awesome
iconSize Size of marker icon Point [22, 22] Icon Options
iconAnchor Anchor size of marker Point [11, 10] Icon Options
iconShape Different shapes of marker icon string circle marker, circle-dot, rectangle, rectangle-dot, doughnut
iconStyle Give any style to marker div string '' Any CSS style
innerIconAnchor Anchor size of font awesome or glyphicon with respect to marker Point [0, 3] Icon Options
innerIconStyle Give any style to font awesome or glyphicon (i.e. HTML i tag) string '' Any CSS style
isAlphaNumericIcon This tells either you want to create marker with icon or text bool false true
text If isAlphaNumericIcon property set to true, then this property use to add text string 1 Any text you want to display on marker
borderColor Border color or marker icon string #1EB300 Use any color with name or its code
borderWidth Border width of marker icon Number 2 Any number according to your requirement
borderStyle Border style of marker icon string solid CSS Border Styles
backgroundColor Background color of marker icon string white Use any color with name or its code
textColor Text color of marker icon string white Use any color with name or its code
customClasses Additional custom classes in the created tag string '' Use any class(es) name
spin Either font awesome or glypicon spin or not bool false true
prefix According to icon library string fa glyphicon
html Create marker by giving own html string '' HTML

Supported Icons

All font awesome and glypicons

Version

Current version of L.BeautyMarker is 1.0

beautifymarker's People

Contributors

alexsegura avatar masajid390 avatar nnseva avatar taleteller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.