[Mapbender-commits] r8829 - in trunk/mapbender/http: css plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu May 8 06:55:55 PDT 2014
Author: hwbllmnn
Date: 2014-05-08 06:55:55 -0700 (Thu, 08 May 2014)
New Revision: 8829
Modified:
trunk/mapbender/http/css/digitize_new.css
trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
added skeleton context menus for digitizing on kml tree
Modified: trunk/mapbender/http/css/digitize_new.css
===================================================================
--- trunk/mapbender/http/css/digitize_new.css 2014-05-08 10:10:06 UTC (rev 8828)
+++ trunk/mapbender/http/css/digitize_new.css 2014-05-08 13:55:55 UTC (rev 8829)
@@ -129,3 +129,15 @@
.digitize-save:hover {
background-image: url('../img/button_blue_red/wmc_save_over');
}
+
+.digitize-zoomto {
+ background-image: url('../img/tree_new/zoom.png');
+}
+
+.digitize-close {
+ background-image: url('../img/tree_new/error.png');
+}
+
+.digitize-contextmenu {
+ line-height: 28px;
+}
Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-08 10:10:06 UTC (rev 8828)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-08 13:55:55 UTC (rev 8829)
@@ -67,32 +67,32 @@
var DigitizeApi = function (o) {
var digitizeHtml = '<div title="Sketch">' +
- '<div class="digitize-image digitize-pencil"></div>' +
- '<fieldset class="fieldset-auto-width">' +
- '<div class="digitize-image digitize-cursor"></div>' +
- '<div class="digitize-image digitize-remove"></div>' +
- '</fieldset><br></br>' +
- '<div class="digitize-image digitize-add"></div>' +
- '<fieldset class="fieldset-auto-width">' +
- '<div class="digitize-image digitize-point"></div>' +
- '<div class="digitize-image digitize-line"></div>' +
- '<div class="digitize-image digitize-polygon"></div>' +
- '</fieldset></div>';
+ '<div class="digitize-image digitize-pencil"></div>' +
+ '<fieldset class="fieldset-auto-width">' +
+ '<div class="digitize-image digitize-cursor"></div>' +
+ '<div class="digitize-image digitize-remove"></div>' +
+ '</fieldset><br></br>' +
+ '<div class="digitize-image digitize-add"></div>' +
+ '<fieldset class="fieldset-auto-width">' +
+ '<div class="digitize-image digitize-point"></div>' +
+ '<div class="digitize-image digitize-line"></div>' +
+ '<div class="digitize-image digitize-polygon"></div>' +
+ '</fieldset></div>';
var editHtml = '<div title="Edit feature">' +
- '<div class="digitize-image digitize-polygon"></div>' +
- '<span>my polygon</span>' +
- '<div class="digitize-image digitize-style"></div>' +
- '<div class="digitize-image digitize-attributes"></div>' +
- '<div class="digitize-image digitize-add"></div>' +
- '<div class="digitize-image digitize-export"></div><br></br>' +
- '<div class="digitize-image digitize-pencil"></div>' +
- '<fieldset class="fieldset-auto-width">' +
- '<div class="digitize-image digitize-move"></div>' +
- '<div class="digitize-image digitize-add-vertex"></div>' +
- '<div class="digitize-image digitize-move-vertex"></div>' +
- '<div class="digitize-image digitize-delete-vertex"></div>' +
- '</div>';
+ '<div class="digitize-image digitize-polygon"></div>' +
+ '<span>my polygon</span>' +
+ '<div class="digitize-image digitize-style"></div>' +
+ '<div class="digitize-image digitize-attributes"></div>' +
+ '<div class="digitize-image digitize-add"></div>' +
+ '<div class="digitize-image digitize-export"></div><br></br>' +
+ '<div class="digitize-image digitize-pencil"></div>' +
+ '<fieldset class="fieldset-auto-width">' +
+ '<div class="digitize-image digitize-move"></div>' +
+ '<div class="digitize-image digitize-add-vertex"></div>' +
+ '<div class="digitize-image digitize-move-vertex"></div>' +
+ '<div class="digitize-image digitize-delete-vertex"></div>' +
+ '</div>';
var editAttributesHtml = '<div title="Feature attributes">' +
'<div class="digitize-image digitize-style"></div>' +
@@ -103,6 +103,33 @@
'<div class="digitize-image digitize-save"></div>' +
'</div>';
+ var folderMenu = '<ul class="digitize-contextmenu">' +
+ '<li><div class="digitize-image digitize-pencil"></div>Edit</li>' +
+ '<li><div class="digitize-image digitize-zoomto"></div>Zoom to</li>' +
+ '<li><div class="digitize-image digitize-add"></div>New</li>' +
+ '<li><div class="digitize-image digitize-export"></div>Export</li>' +
+ '<li><div class="digitize-image digitize-remove"></div>Delete</li>' +
+ '<li><div class="digitize-image digitize-close"></div>Close</li>' +
+ '</ul>';
+
+ var geomMenu = '<ul class="digitize-contextmenu">' +
+ '<li><div class="digitize-image digitize-pencil"></div><span class="margin-left: 30px;">Edit</span></li>' +
+ '<li><div class="digitize-image digitize-zoomto"></div>Zoom to</li>' +
+ '<li><div class="digitize-image digitize-add"></div>New</li>' +
+ '<li><div class="digitize-image digitize-export"></div>Export</li>' +
+ '<li><div class="digitize-image digitize-remove"></div>Delete</li>' +
+ '<li><div class="digitize-image digitize-style"></div>Styling</li>' +
+ '<li><div class="digitize-image digitize-close"></div>Close</li>' +
+ '</ul>';
+
+ var geomPartMenu = '<ul class="digitize-contextmenu">' +
+ '<li><div class="digitize-image digitize-pencil"></div>Edit</li>' +
+ '<li><div class="digitize-image digitize-zoomto"></div>Zoom to</li>' +
+ '<li><div class="digitize-image digitize-export"></div>Export</li>' +
+ '<li><div class="digitize-image digitize-remove"></div>Delete</li>' +
+ '<li><div class="digitize-image digitize-close"></div>Close</li>' +
+ '</ul>';
+
var digitizeDialog,
button,
that = this,
@@ -110,16 +137,6 @@
title = o.title,
defaultHtml = digitizeHtml;
- var hideDigitizeData = function () {
- digitizeDialog.find(".mb-digitize-clicked-point").parent().hide();
- digitizeDialog.find(".mb-digitize-current-point").parent().hide();
- digitizeDialog.find(".mb-digitize-distance-last").parent().hide();
- digitizeDialog.find(".mb-digitize-distance-total").parent().hide();
- digitizeDialog.find(".mb-digitize-perimeter").parent().hide();
- digitizeDialog.find(".mb-digitize-area").parent().hide();
- digitizeDialog.find(".mb-digitize-angle").parent().hide();
- };
-
var create = function () {
//
// Initialise digitize dialog
@@ -145,6 +162,31 @@
go: that.activate,
stop: that.deactivate
});
+
+ // $('.digitize-contextmenu .digitize-close').live('click', function() {
+ // $(this).parents('.digitize-contextmenu').menu('destroy').remove();
+ // });
+ $('li:has(.digitize-close)').live('click', function() {
+ $(this).parent().menu('destroy').remove();
+ });
+
+ $('#mapframe1').bind('kml:loaded', function(evt, item) {
+ var url = item.url;
+ $('li[title="' + url + '"] > a').live('contextmenu', function() {
+ var menu = $(folderMenu);
+ $(document.body).append(menu);
+ var pos = $(this).offset();
+ menu.css({position: 'absolute', top: pos.top, left: pos.left}).menu();
+ return false;
+ });
+ $('li[title="' + url + '"] > ul > li').live('contextmenu', function() {
+ var menu = $(geomMenu);
+ $(document.body).append(menu);
+ var pos = $(this).offset();
+ menu.css({position: 'absolute', top: pos.top, left: pos.left}).menu();
+ return false;
+ });
+ });
};
var finishDigitize = function () {
@@ -192,8 +234,6 @@
.unbind("mb_digitizelastpointadded", finishDigitize)
.unbind("mb_digitizereinitialize", reinitializeDigitize);
}
- hideDigitizeData();
-
if (digitizeDialog.dialog("isOpen")) {
digitizeDialog.dialog("close");
}
More information about the Mapbender_commits
mailing list