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

Merge a lot of PRs from the old repository #8

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e0e71a9
Update README.md
lennardv2 Oct 26, 2013
1232d91
add text option for marker
Mar 28, 2014
72443db
Updated possible color values
Dec 12, 2014
a9ea7a6
Implemented icon rotation support
TheCodeDestroyer Jan 6, 2015
f864f21
fa-inverse instead of icon-white for FA 4.3
Feb 20, 2015
a9cf424
iffing is hard
Feb 20, 2015
f273428
Allow the prefix config option to be falsy.
Mar 18, 2015
930393f
Merge branch '2.0/develop' of https://github.com/kkpoon/Leaflet.aweso…
Mar 18, 2015
85c594d
Correct background-position of White Marker
ghybs Jul 8, 2015
cd5051d
Update Fiddle link on readme
May 18, 2016
3f35924
fix: add package.json to make it installable throw npm
toutpt May 24, 2016
ed3a9d9
new release
Nov 1, 2016
0c3c6f3
Merge remote-tracking branch 'upstream/pr/48' into feature/mergePRs
Dec 1, 2016
477f9e5
Merge remote-tracking branch 'upstream/pr/50' into feature/mergePRs
Dec 1, 2016
6a1e926
Merged #51
Dec 1, 2016
2552763
Merge remote-tracking branch 'upstream/pr/60' into feature/mergePRs
Dec 1, 2016
9126875
Merge remote-tracking branch 'upstream/pr/75' into feature/mergePRs
Dec 1, 2016
6e2bbc6
Merge remote-tracking branch 'upstream/pr/76' into feature/mergePRs
Dec 1, 2016
3cac587
Merge remote-tracking branch 'upstream/pr/77' into feature/mergePRs
Dec 1, 2016
81f1251
Merged #78
Dec 1, 2016
d3c18b5
fixed a small bug and uglified
Dec 1, 2016
009f326
Retina Version of square markers
Jan 24, 2017
d5dab7f
merge with bhaskarvk
Jan 27, 2017
ef317f4
fixing pointers from @theashyster
Feb 1, 2017
4b01137
minor appointments from PR comments
Feb 1, 2017
97ef48a
css version
Feb 1, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
# Leaflet.awesome-markers plugin v2.0
Colorful iconic & retina-proof markers for Leaflet, based on the Glyphicons / Font-Awesome icons

Version 2.0 of Leaflet.awesome-markers is tested with:
- Bootstrap 3
- Font Awesome 4.0
- Ionicons 1.5.2
- Leaflet 0.5-Latest
Version 2.0 of Leaflet.awesome-markers is tested and works with the latest available versions:

For bootstrap 2.x & Fontawesome 3.x use Leaflet.awesome-markers v1.0
* Bootstrap 3 (up to 3.3.7)
* Font Awesome 4.0 (up to 4.7.0)
* Ionicons 1.5.2
* Leaflet 0.5 (up to 1.0.3)

Use version 2.0.x for compatibility with the newer versions of bootstrap, font-awesome and leaflet.

Version 1.0 of Leaflet.awesome-markers is tested and works with:

* Bootstrap 2
* Font Awesome 3.0
* Leaflet 0.5

Use version 1.0.x for compatibility with the older versions of bootstrap, font-awesome and leaflet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have revisited this now, did not see that there is already something written about version 2.0, my bad.
I would suggest that this part is written a bit better all together, like this.

Version 2.0 of Leaflet.awesome-markers is tested and works with the latest available versions:

  • Bootstrap 3 (up to 3.3.7)
  • Font Awesome 4.0 (up to 4.7.0)
  • Ionicons 1.5.2
  • Leaflet 0.5 (up to 1.0.3)

Use version 2.0.x for compatibility with the newer versions of bootstrap, font-awesome and leaflet.

Version 1.0 of Leaflet.awesome-markers is tested and works with:

  • Bootstrap 2
  • Font Awesome 3.0
  • Leaflet 0.5

Use version 1.0.x for compatibility with the older versions of bootstrap, font-awesome and leaflet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur :D.

## Screenshots
![AwesomeMarkers screenshot](https://raw.github.com/lvoogdt/Leaflet.awesome-markers/master/screenshots/screenshot-soft.png "Screenshot of AwesomeMarkers")
<a href="http://jsfiddle.net/VPzu4/92/" target="_blank">JSfiddle demo</a>

<a href="http://jsfiddle.net/VPzu4/975/" target="_blank">JSfiddle demo</a>

### Twitter Bootstrap/Font-Awesome icons
This plugin depends on either Bootstrap or Font-Awesome for the rendering of the icons. See these urls for more information:
Expand Down Expand Up @@ -121,6 +130,8 @@ See [JSFIddle](http://jsfiddle.net/markmarijnissen/VPzu4/286/)
});
````

**note: square markers are only available on the latest versions of Leaflet.Awesome-Markers**

## License
- Leaflet.AwesomeMarkers and colored markers are licensed under the MIT License - http://opensource.org/licenses/mit-license.html.
- Font Awesome: http://fortawesome.github.io/Font-Awesome/license/
Expand Down
7 changes: 5 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "Leaflet.awesome-markers",
"version": "2.0.4",
"homepage": "https://github.com/lvoogdt/Leaflet.awesome-markers",
"homepage": "https://github.com/sigma-geosistemas/Leaflet.awesome-markers",
"authors": [
"Lennard Voogdt <[email protected]>"
"Lennard Voogdt <[email protected]>",
"George Silva <[email protected]>",
"Bhaskar V. Karambelkar <[email protected]>",
"Andris Nolendorfs (https://github.com/theashyster)"
],
"description": "Colorful iconic & retina-proof markers for Leaflet, based on the Glyphicons / Font-Awesome icons",
"main": [
Expand Down
2 changes: 1 addition & 1 deletion dist/leaflet.awesome-markers.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Version: 1.0
}

.awesome-marker-icon-white {
background-position: -574px 0;
background-position: -576px 0;
}

.awesome-marker-icon-gray {
Expand Down
53 changes: 37 additions & 16 deletions dist/leaflet.awesome-markers.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons
(c) 2012-2013, Lennard Voogdt
Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons
(c) 2012-2013, Lennard Voogdt

http://leafletjs.com
https://github.com/lvoogdt
*/
http://leafletjs.com
https://github.com/lvoogdt
*/

/*global L*/

Expand All @@ -31,7 +31,9 @@
extraClasses: '',
icon: 'home',
markerColor: 'blue',
iconColor: 'white'
iconColor: 'white',
iconRotate: 0,
font: 'monospace'
},

initialize: function (options) {
Expand All @@ -56,9 +58,13 @@
},

_createInner: function() {
var iconClass, iconSpinClass = "", iconColorClass = "", iconColorStyle = "", options = this.options;
var iconClass,
iconSpinClass = "",
iconColorClass = "",
iconColorStyle = "",
options = this.options;

if(options.icon.slice(0,options.prefix.length+1) === options.prefix + "-") {
if(!options.prefix || (options.icon.slice(0,options.prefix.length+1) === options.prefix + "-")) {
iconClass = options.icon;
} else {
iconClass = options.prefix + "-" + options.icon;
Expand All @@ -69,14 +75,32 @@
}

if(options.iconColor) {
if(options.iconColor === 'white' || options.iconColor === 'black') {
if ((options.iconColor === 'white' || options.iconColor === 'black') &&
options.prefix !== 'fa') {
iconColorClass = "icon-" + options.iconColor;
} else if (options.prefix === 'fa' && options.iconColor === 'white') {
iconColorClass = "fa-inverse";
} else {
iconColorStyle = "style='color: " + options.iconColor + "' ";
iconColorStyle = "color: " + options.iconColor + ";";
}
}
if(options.font && options.text) {
iconColorStyle += "font-family: " + options.font + ";";
}

if(options.iconRotate && options.iconRotate !== 0) {
iconColorStyle += "-webkit-transform: rotate(" + options.iconRotate + "deg);";
iconColorStyle += "-moz-transform: rotate(" + options.iconRotate + "deg);";
iconColorStyle += "-o-transform: rotate(" + options.iconRotate + "deg);";
iconColorStyle += "-ms-transform: rotate(" + options.iconRotate + "deg);";
iconColorStyle += "transform: rotate(" + options.iconRotate + "deg);";
}

if (options.text) {
return "<i style='" + iconColorStyle + "' class='" + options.extraClasses + " " + (options.prefix || "") + " " + iconSpinClass + " " + iconColorClass + "'>" + options.text + "</i>";
}

return "<i " + iconColorStyle + "class='" + options.extraClasses + " " + options.prefix + " " + iconClass + " " + iconSpinClass + " " + iconColorClass + "'></i>";
return "<i style='" + iconColorStyle + "' class='" + options.extraClasses + " " + (options.prefix || "") + " " + iconClass + " " + iconSpinClass + " " + iconColorClass + "'></i>";
},

_setIconStyles: function (img, name) {
Expand Down Expand Up @@ -112,14 +136,11 @@

this._setIconStyles(div, 'shadow');
return div;
}
}
});

L.AwesomeMarkers.icon = function (options) {
return new L.AwesomeMarkers.Icon(options);
};

}(this, document));



8 changes: 1 addition & 7 deletions dist/leaflet.awesome-markers.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions examples/basic-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="../dist/leaflet.awesome-markers.css">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<link href="https://unpkg.com/[email protected]/css/font-awesome.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="../dist/leaflet.awesome-markers.css"/>
</head>
<body>
<div id="map" style="width: 800px; height: 600px"></div>

<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="../dist/leaflet.awesome-markers.js"></script>
<script>
var map = L.map('map').setView([51.932994,4.509373], 14);

L.tileLayer('http://{s}.tile.cloudmade.com/{key}/22677/256/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade. Font Awesome by Dave Gandy',
key: 'BC9A493B41014CAABB98F0471D759707',
detectRetina: true
}).addTo(map);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(map);

L.marker([51.941196,4.512291], {icon: L.AwesomeMarkers.icon({icon: 'spinner', prefix: 'fa', markerColor: 'red', spin:true}) }).addTo(map);
L.marker([51.927913,4.521303], {icon: L.AwesomeMarkers.icon({icon: 'coffee', prefix: 'fa', markerColor: 'red', iconColor: '#f28f82'}) }).addTo(map);
Expand All @@ -40,6 +39,9 @@
L.marker([51.930295,4.530745], {icon: L.AwesomeMarkers.icon({icon: 'phone', prefix: 'fa', markerColor: 'darkpurple'}) }).addTo(map);
L.marker([51.925055,4.512806], {icon: L.AwesomeMarkers.icon({icon: 'ambulance', prefix: 'fa', markerColor: 'darkgreen'}) }).addTo(map);
L.marker([51.925902,4.505768], {icon: L.AwesomeMarkers.icon({icon: 'medkit', prefix: 'fa', markerColor: 'darkblue'}) }).addTo(map);
L.marker([51.926902,4.502768], {icon: L.AwesomeMarkers.icon({icon: 'home', prefix: 'fa', markerColor: 'white'}) }).addTo(map);
L.marker([51.936902,4.512768], {icon: L.AwesomeMarkers.icon({icon: 'home', prefix: 'fa', markerColor: 'white', text: 'LK' }) }).addTo(map);
L.marker([51.936902,4.516768], {icon: L.AwesomeMarkers.icon({icon: 'shopping-cart', prefix: 'fa', markerColor: 'white', iconRotate: 45 }) }).addTo(map);
</script>
</body>
</html>
26 changes: 11 additions & 15 deletions examples/random-markers.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,25 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="../dist/leaflet.awesome-markers.css">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->

<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>

<link href="https://unpkg.com/[email protected]/css/font-awesome.css" rel="stylesheet"/>
<link rel="stylesheet" href="../dist/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
</head>
<body>
<div id="map" style="width: 800px; height: 600px"></div>

<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="../dist/leaflet.awesome-markers.js"></script>
<script>
var map = L.map('map').setView([51.5, -0.09], 9);

L.tileLayer('http://{s}.tile.cloudmade.com/{key}/22677/256/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade. Font Awesome by Dave Gandy',
key: 'BC9A493B41014CAABB98F0471D759707',
detectRetina: true
}).addTo(map);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(map);

var colors = ['red', 'blue', 'green', 'purple', 'orange', 'darkred', 'lightred', 'beige', 'darkblue', 'darkgreen', 'cadetblue', 'darkpurple', 'white', 'pink', 'lightblue', 'lightgreen', 'gray', 'black', 'lightgray'];

Expand Down
30 changes: 13 additions & 17 deletions examples/with-bootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,27 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" rel="stylesheet">
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="../dist/leaflet.awesome-markers.css">

<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->

<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<link href="https://unpkg.com/[email protected]/css/font-awesome.css" rel="stylesheet"/>
<link href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still 0.7.7, use 1.0.3

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

darn, missed this one.

<link rel="stylesheet" href="../dist/leaflet.awesome-markers.css"/>

</head>
<body>
<div id="map" style="width: 800px; height: 600px"></div>

<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script src="../dist/leaflet.awesome-markers.js"></script>

<script>
var map = L.map('map').setView([51.932994,4.509373], 14);

L.tileLayer('http://{s}.tile.cloudmade.com/{key}/22677/256/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade. Font Awesome by Dave Gandy',
key: 'BC9A493B41014CAABB98F0471D759707'
}).addTo(map);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(map);

L.marker([51.941196,4.512291], {icon: L.AwesomeMarkers.icon({icon: 'link', prefix: 'glyphicon', markerColor: 'red', spin:true}) }).addTo(map);
L.marker([51.927913,4.521303], {icon: L.AwesomeMarkers.icon({icon: 'certificate', prefix: 'glyphicon', markerColor: 'red'}) }).addTo(map);
Expand All @@ -41,7 +37,7 @@

L.marker([51.930454,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'bookmark', prefix: 'fa', markerColor: 'darkred'}) }).addTo(map);
L.marker([51.929607,4.527054], {icon: L.AwesomeMarkers.icon({icon: 'picture-o', prefix: 'fa', markerColor: 'darkblue'}) }).addTo(map);
L.marker([51.928919,4.528856], {icon: L.AwesomeMarkers.icon({icon: 'move', prefix: 'fa', markerColor: 'cadetblue'}) }).addTo(map);
L.marker([51.928919,4.528856], {icon: L.AwesomeMarkers.icon({icon: 'suitcase', prefix: 'fa', markerColor: 'cadetblue'}) }).addTo(map);
L.marker([51.930295,4.530745], {icon: L.AwesomeMarkers.icon({icon: 'play', prefix: 'fa', markerColor: 'darkpurple'}) }).addTo(map);
L.marker([51.925055,4.512806], {icon: L.AwesomeMarkers.icon({icon: 'barcode', prefix: 'fa', markerColor: 'darkgreen'}) }).addTo(map);
L.marker([51.925902,4.505768], {icon: L.AwesomeMarkers.icon({icon: 'inbox', prefix: 'fa', markerColor: 'darkblue'}) }).addTo(map);
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"icons"
],
"author": "Lennard Voogdt and Sigma Geosistemas",
"contributors": [
"George Silva <[email protected]>",
"Bhaskar V. Karambelkar <[email protected]>",
"Andris Nolendorfs (https://github.com/theashyster)"
],
"license": "ISC",
"bugs": {
"url": "https://github.com/sigma-geosistemas/Leaflet.awesome-markers/issues"
Expand Down