Merge branch 'develop' into refactor_type_de_xxx

Conflicts:
	db/schema.rb
This commit is contained in:
Tanguy PATTE 2015-11-20 17:16:45 +01:00
commit d6e4a76bf9
73 changed files with 1352 additions and 212 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -18,4 +18,10 @@
//= require bootstrap-sprockets
//= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
//= require leaflet
//= require leaflet.js
//= require d3.min
//= require clipper
//= require concavehull.min
//= require graham_scan.min
//= require leaflet.freedraw

View file

@ -1,10 +1,64 @@
//récupération de la position de l'entreprise
function initCarto() {
OSM = L.tileLayer("http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
function get_position(){
var LON = '2.428462';
var LAT = '46.538192';
position = get_position() || {lon: LON, lat: LAT, zoom: 13};
if (typeof position.zoom == 'undefined')
position.zoom = 13;
var map = L.map("map", {
center: new L.LatLng(position.lat, position.lon),
zoom: position.zoom,
layers: [OSM]
});
var freeDraw = new L.FreeDraw({
//mode: L.FreeDraw.MODES.CREATE
});
map.addLayer(freeDraw);
if ($("#json_latlngs").val() != '' && $("#json_latlngs").val() != '[]') {
$.each($.parseJSON($("#json_latlngs").val()), function (i, val) {
freeDraw.createPolygon(val);
});
map.fitBounds(freeDraw.polygons[0].getBounds());
}
else if (position.lat == LAT && position.lon == LON)
map.setView(new L.LatLng(position.lat, position.lon), 5);
add_event_freeDraw(freeDraw);
}
function add_event_freeDraw(freeDraw) {
freeDraw.on('markers', function (e) {
$("#json_latlngs").val(JSON.stringify(e.latLngs));
});
$("#new").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.CREATE);
});
$("#edit").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.EDIT);
});
$("#delete").on('click', function (e) {
freeDraw.setMode(L.FreeDraw.MODES.DELETE);
});
}
function get_position() {
var position;
$.ajax({
url: '/users/dossiers/'+dossier_id+'/carte/position',
url: '/users/dossiers/' + dossier_id + '/carte/position',
dataType: 'json',
async: false
}).done(function (data) {
@ -12,23 +66,4 @@ function get_position(){
});
return position;
}
function get_ref_dossier (){
$.post("http://apicarto.coremaps.com/api/v1/datastore", {
contentType: "application/json",
dataType: 'json',
geom: JSON.stringify(window.featureCollection.features[0]),
ascyn: false
}).done(function (data) {
$("#ref_dossier").val(data.reference);
});
}
function submit_check_draw(e) {
if (window.location.href.indexOf('carte') > -1 && window.featureCollection.features.length == 0) {
$("#flash_message").html('<div class="alert alert-danger">Un dessin est obligatoire.</div>');
e.preventDefault();
return false;
}
}

View file

@ -0,0 +1,32 @@
#backoffice_search {
.table {
tr th {
border-top: none
}
}
ul {
li {
margin-top: 11px;
a {
height: 45px;
h5 {
margin-top: 4px;
}
}
}
#search {
margin-top: 0;
a {
height: auto;
}
a:hover {
height: 56px;
background-color: transparent;
border: none;
padding: 11px 16px;
}
}
}
}

View file

@ -5,6 +5,88 @@
table {
font-size: 13;
}
#map{
height:600px;
width: 100%;
}
#map.mini{
height:300px;
}
#map section.overlay {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
box-shadow: inset -100px 0 100px -100px rgba(0, 0, 0, .25);
width: 100%;
height: 100%;
z-index: 2001;
}
#map.mode-create {
cursor: crosshair !important;
}
#map g path {
transition: all 0.25s;
stroke-width: 4px;
stroke-opacity: 1;
stroke: #D7217E;
position: absolute;
z-index: 1001;
fill: #D7217E;
fill-opacity: .75;
-webkit-filter: none;
}
#map.mode-delete path {
cursor: no-drop !important;
}
#map.mode-delete path:hover {
fill: #4d4d4d !important;
}
#map div.polygon-elbow {
-webkit-transition: opacity .25s;
box-shadow: 0 0 0 2px white, 0 0 10px rgba(0, 0, 0, .35);
border: 5px solid #D7217E;
border-radius: 10px;
transition: opacity 0.25s;
cursor: move;
opacity: 0;
pointer-events: none;
box-sizing: border-box;
width: 0 !important;
height: 0 !important;
}
#map div.polygon-elbow.non-polygon {
opacity: 0 !important;
pointer-events: none !important;
border: 5px solid darkgray;
}
#map.mode-edit div.polygon-elbow {
opacity: 1;
pointer-events: all;
}
#map svg.tracer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2001;
pointer-events: none;
}
.info {
padding: 6px 8px;
font: 14px/16px Arial, Helvetica, sans-serif;