Skip to content

Commit

Permalink
Alterações do mapa dos cafés
Browse files Browse the repository at this point in the history
  • Loading branch information
joelxr committed Jul 25, 2016
1 parent 0a565af commit d5a1a68
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 20 deletions.
4 changes: 1 addition & 3 deletions _includes/5.0-stars.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div class="yellow-text text-darken-3">
<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>
</div>
<div class="yellow-text text-darken-3"><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></div>
5 changes: 4 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
<link rel="icon" href="{{ site.baseurl }}/assets/images/icons/favicon-62.png" sizes="62x62" type="image/png"/>
<link rel="icon" href="{{ site.baseurl }}/assets/images/icons/favicon-192.png" sizes="192x192" type="image/png"/>
<!-- Mapbox -->

<script type="text/javascript" src="{{ site.baseurl }}/assets/js/mapbox.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/assets/js/leaflet.markercluster.js"></script>
<link type="text/css" rel="stylesheet" href="{{ site.baseurl }}/assets/css/mapbox.css">
<link type="text/css" rel="stylesheet" href="{{ site.baseurl }}/assets/css/leaflet.css">
<link type="text/css" rel="stylesheet" href="{{ site.baseurl }}/assets/css/leaflet.markercluster.css">
<link type="text/css" rel="stylesheet" href="{{ site.baseurl }}/assets/css/leaflet.markercluster.defaut.css">

<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
</head>
1 change: 1 addition & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div class="nav-wrapper">
<a href="{{site.baseurl}}/" class="brand-logo center"><i class="fa fa-coffee"></i> {{site.title}}</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a href="{{site.baseurl}}/">Home</a></li>
<li><a href="{{ site.baseurl }}/mapa">Mapa</a></li>
{% for page in site.pages %}
{% if page.title %}
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"Materialize": "materialize#^0.97.6",
"font-abel": "^1.0.0",
"jquery": "2.1.4",
"mapbox.js": "^2.4.0"
"mapbox.js": "^2.4.0",
"leaflet.markercluster": "^0.5.0"
},
"devDependencies": {
"jquery": "2.1.4"
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<spam class="post-link">
<spam class="activator">{{ post.title }}</spam>
<spam class="right">
<a class="btn-floating btn-small waves-effect waves-light brown" href="{{ post.url | prepend: site.baseurl }}">
<i class="fa fa-info"></i>
<a class="btn-link btn-small" href="{{ post.url | prepend: site.baseurl }}">
<i class="fa fa-info-circle"></i>
</a>
</spam>
</spam>
Expand Down
27 changes: 16 additions & 11 deletions mapa/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@
{% if post.rate == 0.5 %}
rate: '<i class="fa fa-star-half-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 1 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 1.5 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star-half-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 2 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 2.5 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-half-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 3 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 3.5 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-half-o"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 4 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i>',
{% elsif post.rate == 4.5 %}
rate: '',
rate: '<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-half-o"></i>',
{% elsif post.rate == 5 %}
rate: '',
rate: '<div class="yellow-text text-darken-3"><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></div>',
{% endif %}
'marker-size': 'large',
'marker-color': '#BE9A6B',
Expand All @@ -66,14 +66,19 @@
e.layer.openPopup();
});

myLayer.on('ready', function() {
myLayer.on('ready', function(e) {
map.fitBounds(myLayer.getBounds());
var clusterGroup = new L.MarkerClusterGroup();
e.target.eachLayer(function(layer) {
clusterGroup.addLayer(layer);
});
map.addLayer(clusterGroup);
});

myLayer.on('layeradd', function(e) {
var marker = e.layer;
var feature = marker.feature;
var popupContent =
var popupContent =
'<ul style="margin-left: 2px;">' +
'<li><a target="_blank" style="max-width:100%" href="' + feature.properties.url + '">' + feature.properties.title + '</a></li>' +
'<li>' + feature.properties.rate + '</li>' +
Expand Down
49 changes: 47 additions & 2 deletions tasks/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,29 @@ module.exports = function(grunt){
src: '**',
dest: 'assets/css/images/',
filter: 'isFile'
}
},
{
src: 'assets/vendor/leaflet/dist/leaflet.css',
dest: 'assets/css/leaflet.css',
filter: 'isFile'
},
{
expand: true,
cwd: 'assets/vendor/leaflet/dist/images/',
src: '**',
dest: 'assets/css/images/',
filter: 'isFile'
},
{
src: 'assets/vendor/leaflet.markercluster/dist/MarkerCluster.css',
dest: 'assets/css/leaflet.markercluster.css',
filter: 'isFile'
},
{
src: 'assets/vendor/leaflet.markercluster/dist/MarkerCluster.Default.css',
dest: 'assets/css/leaflet.markercluster.default.css',
filter: 'isFile'
},
]
},
dev: {
Expand Down Expand Up @@ -87,7 +109,30 @@ module.exports = function(grunt){
src: '**',
dest: '_site/assets/css/images/',
filter: 'isFile'
}
},
{
src: 'assets/vendor/leaflet/dist/leaflet.css',
dest: '_site/assets/css/leaflet.css',
filter: 'isFile'
},
{
expand: true,
cwd: 'assets/vendor/leaflet/dist/images/',
src: '**',
dest: '_site/assets/css/images/',
filter: 'isFile'
},
{
src: 'assets/vendor/leaflet.markercluster/dist/MarkerCluster.css',
dest: '_site/assets/css/leaflet.markercluster.css',
filter: 'isFile'
},
{
src: 'assets/vendor/leaflet.markercluster/dist/MarkerCluster.Default.css',
dest: '_site/assets/css/leaflet.markercluster.default.css',
filter: 'isFile'
},

]
}
});
Expand Down
4 changes: 4 additions & 0 deletions tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ module.exports = function(grunt){
'assets/js/jquery.js' : 'assets/vendor/jquery/dist/jquery.js',
'assets/js/materialize.js' : 'assets/vendor/Materialize/dist/js/materialize.js',
'assets/js/mapbox.js' : 'assets/vendor/mapbox.js/mapbox.js',
'assets/js/leaflet.js' : 'assets/vendor/leaflet/dist/leaflet-src.js',
'assets/js/leaflet.markercluster.js' : 'assets/vendor/leaflet.markercluster/dist/leaflet.markercluster-src.js',
}
},
dev: {
files: {
'_site/assets/js/jquery.js' : 'assets/vendor/jquery/dist/jquery.js',
'_site/assets/js/materialize.js' : 'assets/vendor/Materialize/dist/js/materialize.js',
'_site/assets/js/mapbox.js' : 'assets/vendor/mapbox.js/mapbox.js',
'_site/assets/js/leaflet.js' : 'assets/vendor/leaflet/dist/leaflet.js',
'_site/assets/js/leaflet.markercluster.js' : 'assets/vendor/leaflet.markercluster/dist/leatlet.markercluster.js',
}
}
});
Expand Down

0 comments on commit d5a1a68

Please sign in to comment.