Commit d30f0ba6 authored by Geoffrey Vedernikoff's avatar Geoffrey Vedernikoff

Fixes drawing issues

parent 822dd85c
......@@ -168,6 +168,32 @@
return true;
}
// set up Leaflet.draw editor
var drawOptions = {
draw: {
// circles are not geometries in geojson
circle: false
},
edit: {
featureGroup: editableLayers
}
}
if ($.inArray(geometryType, ["POINT", "MULTIPOINT"]) > -1) {
drawOptions.draw.polyline = false;
drawOptions.draw.polygon = false;
drawOptions.draw.rectangle = false;
} else if ($.inArray(geometryType, ["LINESTRING", "MULTILINESTRING"]) > -1) {
drawOptions.draw.marker = false;
drawOptions.draw.polygon = false;
drawOptions.draw.rectangle = false;
} else if ($.inArray(geometryType, ["POLYGON", "MULTIPOLYGON"]) > -1) {
drawOptions.draw.marker = false;
drawOptions.draw.polyline = false;
}
var drawControl = new L.Control.Draw(drawOptions);
map.addControl(drawControl);
if (window.google) {
var geocoder = new google.maps.Geocoder();
......@@ -197,31 +223,6 @@
}));
}
// set up Leaflet.draw editor
var drawOptions = {
draw: {
// circles are not geometries in geojson
circle: false
},
edit: {
featureGroup: editableLayers
}
}
if ($.inArray(geometryType, ["POINT", "MULTIPOINT"]) > -1) {
drawOptions.draw.polyline = false;
drawOptions.draw.polygon = false;
drawOptions.draw.rectangle = false;
} else if ($.inArray(geometryType, ["LINESTRING", "MULTILINESTRING"]) > -1) {
drawOptions.draw.marker = false;
drawOptions.draw.polygon = false;
drawOptions.draw.rectangle = false;
} else if ($.inArray(geometryType, ["POLYGON", "MULTIPOLYGON"]) > -1) {
drawOptions.draw.marker = false;
drawOptions.draw.polyline = false;
}
var drawControl = new L.Control.Draw(drawOptions);
map.addControl(drawControl);
// save when the editableLayers are edited
var saveToTextArea = function() {
......
......@@ -15,4 +15,4 @@
*
*/
eaflet-container .leaflet-control-search{position:relative;float:left;background:#fff;color:#1978cf;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:rgba(255,255,255,.8);z-index:1000;box-shadow:0 1px 7px rgba(0,0,0,.65);margin-left:10px;margin-top:10px}.leaflet-control-search.search-exp{box-shadow:0 1px 7px #999;background:#fff}.leaflet-control-search .search-input{display:block;float:left;background:#fff;border:1px solid #666;border-radius:2px;height:18px;padding:0 18px 0 2px;margin:3px 0 3px 3px}.leaflet-control-search.search-load .search-input{background:url(./images/loader.gif) no-repeat center right #fff}.leaflet-control-search.search-load .search-cancel{visibility:hidden}.leaflet-control-search .search-cancel{display:block;width:22px;height:18px;position:absolute;right:22px;margin:3px 0;background:url(./images/search-icon.png) no-repeat 0 -46px;text-decoration:none;filter:alpha(opacity=80);opacity:.8}.leaflet-control-search .search-cancel:hover{filter:alpha(opacity=100);opacity:1}.leaflet-control-search .search-cancel span{display:none;font-size:18px;line-height:20px;color:#ccc;font-weight:700}.leaflet-control-search .search-cancel:hover span{color:#aaa}.leaflet-control-search .search-button{display:block;float:left;width:26px;height:26px;background:url(./images/search-icon.png) no-repeat 2px 2px;border-radius:4px}.leaflet-control-search .search-button:hover{background:url(./images/search-icon.png) no-repeat 2px -22px}.leaflet-control-search .search-tooltip{position:absolute;top:100%;left:0;float:left;min-width:120px;max-height:122px;box-shadow:1px 1px 6px rgba(0,0,0,.4);background-color:rgba(0,0,0,.25);z-index:1010;overflow-y:auto;overflow-x:hidden}.leaflet-control-search .search-tip{margin:2px;padding:2px 4px;display:block;color:#000;background:#eee;border-radius:.25em;text-decoration:none;white-space:nowrap;vertical-align:center}.leaflet-control-search .search-button:hover,.leaflet-control-search .search-tip-select,.leaflet-control-search .search-tip:hover{background-color:#fff}.leaflet-control-search .search-alert{cursor:pointer;clear:both;font-size:.75em;margin-bottom:5px;padding:0 .25em;color:#e00;font-weight:700;border-radius:.25em}
.leaflet-container .leaflet-control-search{position:relative;float:left;background:#fff;color:#1978cf;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:rgba(255,255,255,.8);z-index:1000;box-shadow:0 1px 7px rgba(0,0,0,.65);margin-left:10px;margin-top:10px}.leaflet-control-search.search-exp{box-shadow:0 1px 7px #999;background:#fff}.leaflet-control-search .search-input{display:block;float:left;background:#fff;border:1px solid #666;border-radius:2px;height:18px;padding:0 18px 0 2px;margin:3px 0 3px 3px}.leaflet-control-search.search-load .search-input{background:url(./images/loader.gif) no-repeat center right #fff}.leaflet-control-search.search-load .search-cancel{visibility:hidden}.leaflet-control-search .search-cancel{display:block;width:22px;height:18px;position:absolute;right:22px;margin:3px 0;background:url(./images/search-icon.png) no-repeat 0 -46px;text-decoration:none;filter:alpha(opacity=80);opacity:.8}.leaflet-control-search .search-cancel:hover{filter:alpha(opacity=100);opacity:1}.leaflet-control-search .search-cancel span{display:none;font-size:18px;line-height:20px;color:#ccc;font-weight:700}.leaflet-control-search .search-cancel:hover span{color:#aaa}.leaflet-control-search .search-button{display:block;float:left;width:26px;height:26px;background:url(./images/search-icon.png) no-repeat 2px 2px;border-radius:4px}.leaflet-control-search .search-button:hover{background:url(./images/search-icon.png) no-repeat 2px -22px}.leaflet-control-search .search-tooltip{position:absolute;top:100%;left:0;float:left;min-width:120px;max-height:122px;box-shadow:1px 1px 6px rgba(0,0,0,.4);background-color:rgba(0,0,0,.25);z-index:1010;overflow-y:auto;overflow-x:hidden}.leaflet-control-search .search-tip{margin:2px;padding:2px 4px;display:block;color:#000;background:#eee;border-radius:.25em;text-decoration:none;white-space:nowrap;vertical-align:center}.leaflet-control-search .search-button:hover,.leaflet-control-search .search-tip-select,.leaflet-control-search .search-tip:hover{background-color:#fff}.leaflet-control-search .search-alert{cursor:pointer;clear:both;font-size:.75em;margin-bottom:5px;padding:0 .25em;color:#e00;font-weight:700;border-radius:.25em}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment