[Mapbender-commits] r8964 - in trunk/mapbender: http/plugins lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Jul 1 07:30:33 PDT 2014
Author: hwbllmnn
Date: 2014-07-01 07:30:33 -0700 (Tue, 01 Jul 2014)
New Revision: 8964
Modified:
trunk/mapbender/http/plugins/kmlTree.js
trunk/mapbender/http/plugins/mb_digitize_widget.php
trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
Log:
added select button for features, only partially disable digitizing when other icons are selected
Modified: trunk/mapbender/http/plugins/kmlTree.js
===================================================================
--- trunk/mapbender/http/plugins/kmlTree.js 2014-07-01 13:58:00 UTC (rev 8963)
+++ trunk/mapbender/http/plugins/kmlTree.js 2014-07-01 14:30:33 UTC (rev 8964)
@@ -73,6 +73,9 @@
$kmlTree.append($KMLfolder);
$addButton = $('<button class="add" name="addkml" value="addkml"></button>');
+
+ var selectButton = $('<button class="digitize-image digitize-cursor"></button>');
+
$addButton.click(function(){
var dlg = $('<div ></div>').dialog({
"title": "KML hinzufügen",
@@ -183,8 +186,18 @@
ifr.onload = onloadfun;
});
});
+ $KMLfolder.find('ul').before(selectButton);
$KMLfolder.find("ul").before($addButton);
+ selectButton.bind('click', function() {
+ var kml = $('#mapframe1').data('kml');
+ if(kml.getQueriedLayer) {
+ kml.setQueriedLayer = false;
+ } else {
+ kml.setQueriedLayer(true);
+ }
+ });
+
o.$target.bind('kml:loaded',function(e,obj){
//console.log(obj);
var checked = obj.display ? 'checked="checked"':'';
Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-07-01 13:58:00 UTC (rev 8963)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-07-01 14:30:33 UTC (rev 8964)
@@ -184,10 +184,7 @@
name: 'kml-digitizer-pseudo',
go: $.noop,
stop: function() {
- digitizeDialog.dialog('close');
- editDialog.dialog('close');
- editStyleDialog.dialog('close');
- attributesDialog.dialog('close');
+ that.deactivate();
}
});
@@ -515,6 +512,7 @@
var editObject = function($link, menu) {
return function(e) {
+
editDialog.find('*').unbind();
if($link.hasClass('kmltree-selected')) {
editDialog.dialog('close');
@@ -622,10 +620,6 @@
digitizingFor = $link.parent().attr('title');
that.activate();
});
- digitizeDialog.find('.digitize-cursor').bind('click', function() {
- var kml = $('#mapframe1').data('kml');
- kml.setQueriedLayer($link.parent().attr('title'));
- });
digitizeDialog.find('.digitize-remove').bind('click', function() {
var kml = $('#mapframe1').data('kml');
var url = $link.parent().attr('title');
Modified: trunk/mapbender/lib/mb.ui.displayKmlFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-07-01 13:58:00 UTC (rev 8963)
+++ trunk/mapbender/lib/mb.ui.displayKmlFeatures.js 2014-07-01 14:30:33 UTC (rev 8964)
@@ -66,24 +66,26 @@
var matched = [];
var matchedIds = [];
- $.each(itm.data.features, function(k, v) {
- if(v.geometry.type.match(/point/i)) {
- var pt = Proj4js.transform(self.wgs84, self.targetProj, {x: v.geometry.coordinates[0], y: v.geometry.coordinates[1]});
- var minx = pt.x - 20 * res;
- var miny = pt.y - 20 * res;
- var maxx = minx + 40 * res;
- var maxy = miny + 40 * res;
- if(minx < clickPoint.x && maxx > clickPoint.x && miny < clickPoint.y && maxy > clickPoint.y) {
- matched.push(v);
- matchedIds.push(k);
+ $.each(self._kmls, function(_, itm) {
+ $.each(itm.data.features, function(k, v) {
+ if(v.geometry.type.match(/point/i)) {
+ var pt = Proj4js.transform(self.wgs84, self.targetProj, {x: v.geometry.coordinates[0], y: v.geometry.coordinates[1]});
+ var minx = pt.x - 20 * res;
+ var miny = pt.y - 20 * res;
+ var maxx = minx + 40 * res;
+ var maxy = miny + 40 * res;
+ if(minx < clickPoint.x && maxx > clickPoint.x && miny < clickPoint.y && maxy > clickPoint.y) {
+ matched.push(v);
+ matchedIds.push(k);
+ }
+ } else {
+ var box = self.getBbox(v);
+ if(box[0] < wgspt.x && box[2] > wgspt.x && box[1] < wgspt.y && box[3] > wgspt.y) {
+ matched.push(v);
+ matchedIds.push(k);
+ }
}
- } else {
- var box = self.getBbox(v);
- if(box[0] < wgspt.x && box[2] > wgspt.x && box[1] < wgspt.y && box[3] > wgspt.y) {
- matched.push(v);
- matchedIds.push(k);
- }
- }
+ });
});
if(matchedIds.length > 0) {
More information about the Mapbender_commits
mailing list