Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to insert own HTML instead of predefined icons #18

Merged
merged 1 commit into from Feb 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -65,6 +65,7 @@ Now use the plugin to create a marker like this:
| Property | Description | Default Value | Possible values |
| --------------- | ---------------------------- | ------------- | ---------------------------------------------------- |
| icon | Name of the icon WITH prefix | 'fa-home' | See glyphicons or font-awesome (must include prefix) |
| innerHTML | own HTML code | '' | can be used to use SVG or PNG files |
| prefix | Select de icon library | 'glyphicon' | 'fa' for font-awesome or 'glyphicon' for bootstrap 3 |
| markerColor | Color of the marker | 'blue' | 'red', 'orange-dark', 'orange', 'yellow', 'blue-dark', 'cyan', 'purple', 'violet', 'pink', 'green-dark', 'green', 'green-light', 'black', 'white' |
| shape | Shape of the marker | 'circle' | 'circle', 'square', 'star', 'penta' |
Expand Down
4 changes: 4 additions & 0 deletions src/assets/js/leaflet.extra-markers.js
Expand Up @@ -22,6 +22,7 @@
extraClasses: "",
shape: "circle",
icon: "",
innerHTML: "",
markerColor: "red",
iconColor: "#fff",
number: ""
Expand All @@ -34,6 +35,9 @@
if (options.icon) {
div.innerHTML = this._createInner();
}
if (options.innerHTML) {
div.innerHTML = options.innerHTML;
}
if (options.bgPos) {
div.style.backgroundPosition = -options.bgPos.x + "px " + -options.bgPos.y + "px";
}
Expand Down