- add bower for rails

- add "wildhoney_leaflet_freedraw" bower vendor
- remove api_carto
This commit is contained in:
Xavier J 2015-11-10 18:08:47 +01:00
parent fd9061abdf
commit eadb42af93
16 changed files with 106 additions and 56 deletions

View file

@ -18,4 +18,9 @@
//= require bootstrap-sprockets
//= require bootstrap-datepicker/core
//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr.js
//= require leaflet
//= require leaflet
//= require d3
//= require evispa-timo-jsclipper
//= require concavehull
//= require graham_scan
//= require wildhoney_leaflet_freedraw

View file

@ -1,10 +1,30 @@
//récupération de la position de l'entreprise
function get_position(){
function initCarto() {
OSM = L.tileLayer("http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {
attribution: '&copy; Openstreetmap France | &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
position = get_position();
var map = L.map("map", {
center: new L.LatLng(position.lat, position.lon),
zoom: 13,
layers: [OSM]
});
freeDraw = new L.FreeDraw({
mode: L.FreeDraw.MODES.CREATE
});
map.addLayer(freeDraw);
}
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) {
@ -14,7 +34,7 @@ function get_position(){
return position;
}
function get_ref_dossier (){
function get_ref_dossier() {
$.post("http://apicarto.coremaps.com/api/v1/datastore", {
contentType: "application/json",
dataType: 'json',

View file

@ -5,6 +5,19 @@
table {
font-size: 13;
}
#map.mode-create {
cursor: crosshair;
}
svg.tracer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.info {
padding: 6px 8px;
font: 14px/16px Arial, Helvetica, sans-serif;

View file

@ -1,5 +0,0 @@
%div#sources_CSS_api_carto
%link{:href => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.css", :rel => "stylesheet", :type => "text/css"}
%link{:href => "https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css", :rel => "stylesheet"}
%link{:href => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/dd04bbf160aa33c44aa63e8a744b3632c162c340/src/easy-button.css", :rel => "stylesheet"}

View file

@ -1,11 +0,0 @@
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
%div#sources_JS_api_carto
%script{:src => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"}
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.bar.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.button.js"}

View file

@ -1,12 +0,0 @@
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
="var ref_dossier=#{@dossier.ref_dossier_carto}"
%div#sources_JS_api_carto_backend
%script{:src => "https://leaflet.github.io/Leaflet.draw/leaflet.draw.js"}
%script{:src => "https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.0.1/spin.min.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.bar.js"}
%script{:src => "https://cdn.rawgit.com/CliffCloud/Leaflet.EasyButton/14332b70b18bdec80f4cce86c643372883bf90aa/src/easy-button.button.js"}

View file

@ -2,18 +2,26 @@
='Localisation de votre demande'
%br
=render partial: 'carte_sources_CSS'
.content{style:'margin-bottom:60px'}
%button.btn.btn-sm.btn-success{type:'button', disabled: 'disabled'} Nouveau
\-
%button.btn.btn-sm.btn-info{type:'button', disabled: 'disabled'} Editer
\-
%button.btn.btn-sm.btn-danger{type:'button', disabled: 'disabled'} Supprimer
.content
#map_qp{style: 'height:600px; width: 100%;'}
= form_tag(url_for({controller: :carte, action: :save_ref_api_carto, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
%br
%input{type: 'hidden', value: '', name: 'ref_dossier', id: 'ref_dossier'}
%br
#map{style: 'height:600px; width: 100%;'}
-if @dossier.draft?
=render partial: '/layouts/etape_suivante'
-else
=render partial: '/layouts/modifications_terminees'
= form_tag(url_for({controller: :carte, action: :save_ref_api_carto, dossier_id: @dossier.id}), class: 'form-inline', method: 'POST') do
%br
%input{type: 'hidden', value: '', name: 'ref_dossier', id: 'ref_dossier'}
=render partial: 'carte_sources_JS'
-if @dossier.draft?
=render partial: '/layouts/etape_suivante'
-else
=render partial: '/layouts/modifications_terminees'
%script{type: 'text/javascript'}
="var dossier_id =#{@dossier.id}"
initCarto();