Skip to content

Commit

Permalink
Merge pull request #158 from fga-gpp-mds/devel
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
rafaelrabetti authored Jun 24, 2017
2 parents f782f29 + 3ad508f commit 6fc97e9
Show file tree
Hide file tree
Showing 38 changed files with 731 additions and 287 deletions.
Binary file added darcyWeb/app/assets/images/logo-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions darcyWeb/app/assets/javascripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

//= require map/init
//= require map/sidebar
//= require map/about
//= require map/routes
//= require map/search
//= require map/share_location
Expand Down
12 changes: 12 additions & 0 deletions darcyWeb/app/assets/javascripts/map/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$(".btn-about").click(function(e){
e.preventDefault();
$("#sidebar").load("about", function(){
if(!sidebar.isVisible()){
sidebar.show();
}
else
sidebar.hide();
})


})
12 changes: 12 additions & 0 deletions darcyWeb/app/assets/javascripts/map/data/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ const roomColor = function color(type) {
case "amphitheater":
color = "#8BC34A";
break;
case "academic_center":
color = "#2A7E43";
break;
case "kitchen":
color = "#A56300";
break;
case "SAA":
color = "#AA3939";
break;
case "others":
color = "#000";
break;
}

return color;
Expand Down
2 changes: 1 addition & 1 deletion darcyWeb/app/assets/javascripts/map/filter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var urlWorld = "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}";

var esri_WorldImagery = L.tileLayer(urlWorld, {
maxZoom: 20,
maxZoom: 19,
maxNativeZoom: 22,
attribution: "Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
});
Expand Down
6 changes: 4 additions & 2 deletions darcyWeb/app/assets/javascripts/map/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ var setLabelContent = function setLabelContent(tooltip, content, offset) {

map.on("moveend", function(e) {

var zoom = map.getZoom();

buildingLayer.getLayers().forEach(function(building) {

var properties = building.feature.properties.building;
var tooltip = building.getTooltip();

if (map.getZoom() >= zoomTooltipBuilding) {
if (zoom >= zoomTooltipBuilding) {
setLabelContent(tooltip, properties.title, titleTooltipOffset);
} else {
setLabelContent(tooltip, properties.acronym, acronymTooltipOffset);
Expand All @@ -38,7 +40,7 @@ map.on("moveend", function(e) {
var properties = room.feature.properties.room;
var tooltip = room.getTooltip();

if (map.getZoom() >= zoomTooltipRoom) {
if (zoom >= zoomTooltipRoom) {
setLabelContent(tooltip, properties.title, titleTooltipOffset);
} else {
setLabelContent(tooltip, properties.acronym, acronymTooltipOffset);
Expand Down
16 changes: 13 additions & 3 deletions darcyWeb/app/assets/javascripts/map/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ MapObj.control.on("routesfound", function(e) {

MapObj.control.on("routingerror", function() {
// TODO Show message when it"s not possible to calculate routes

swal("Oops...", "Não foi possível obter o trajeto desejado.", "error");
});

/**************** POSITION ****************/
Expand Down Expand Up @@ -143,6 +143,10 @@ function loadRouteForm(data) {
reverseRoute(e);
});

$(".close.routes").click(function() {
unLoadRoute();
});


// instantiate route form elements when the page is loaded
FormObj = new Form();
Expand Down Expand Up @@ -214,9 +218,13 @@ function unLoadRoute() {
sidebar.hide();

// remove markers from map
MapObj.removeMarker(RouteObj.origin);
MapObj.removeMarker(RouteObj.destination);
if(RouteObj.origin.marker !== "null") {
MapObj.removeMarker(RouteObj.origin);
}

if(RouteObj.destination.marker !== "null") {
MapObj.removeMarker(RouteObj.destination);
}
// removes route from map
MapObj.control.spliceWaypoints(0, 2);

Expand All @@ -229,9 +237,11 @@ function unLoadRoute() {
function fillFormRouteLocations(data) {
if ("origin" in data) {
FormObj.origin.val(data.origin);
FormObj.originText.val(data.origin);
}
if ("destination" in data) {
FormObj.destination.val(data.destination);
FormObj.destinationText.val(data.destination);
}
}

Expand Down
2 changes: 1 addition & 1 deletion darcyWeb/app/assets/javascripts/map/share_location.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function createMarker(waypoint, latlng) {
});
map.addLayer(waypoint.marker);

map.setView(latlng, 32, {
map.setView(latlng, 16, {
animate: true
});
//map.setZoom(200, {animate: true});
Expand Down
14 changes: 7 additions & 7 deletions darcyWeb/app/assets/javascripts/map/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//= require leaflet/sidebar

var sidebar = L.control.sidebar("sidebar", {
position: "left",
autoPan: false,
closeButton: false
position: "left",
autoPan: false,
closeButton: false
}).addTo(map);

//var visible = sidebar.isVisible();

sidebar.on("show", function(){
//$(".leaflet-map-pane").css("height", "50%");
$("#sidebar").bind("DOMSubtreeModified", function() {
$(".close").click(function() {
sidebar.hide();
});
});
7 changes: 2 additions & 5 deletions darcyWeb/app/assets/stylesheets/about.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif}
.w3-bar,h1,button {font-family: "Roboto", sans-serif}
.fa-anchor,.fa-coffee {font-size:200px}
body{
overflow:auto;
.img-circle {
border-radius: 50%;
}

footer{
Expand Down
4 changes: 4 additions & 0 deletions darcyWeb/app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
*= require_tree .
*= require_self
*/

.team-photo {
height: 50px;
}
Loading

0 comments on commit 6fc97e9

Please sign in to comment.