[Mapbender-commits] r5193 - in trunk/mapbender: http/javascripts lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Dec 16 04:10:04 EST 2009
Author: kmq
Date: 2009-12-16 04:10:01 -0500 (Wed, 16 Dec 2009)
New Revision: 5193
Modified:
trunk/mapbender/http/javascripts/mod_ResultList.js
trunk/mapbender/lib/resultGeometryListController.js
Log:
Highlighting for entries in datatable that don't start as visible
Modified: trunk/mapbender/http/javascripts/mod_ResultList.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_ResultList.js 2009-12-16 08:49:03 UTC (rev 5192)
+++ trunk/mapbender/http/javascripts/mod_ResultList.js 2009-12-16 09:10:01 UTC (rev 5193)
@@ -1,5 +1,11 @@
//check element vars
var display_popup = display_popup || true;
+options.infoPopupHeight = options.infoPopupHeight || 250;
+options.infoPopupWidth = options.infoPopupWidth || 400;
+options.maxHighlightedPoints = options.maxHighlightedPoints || 5;
+options.resultHighlightColor = options.resultHighlightColor || "#ff0000";
+options.resultHighlightZIndex = options.resultHighlightZIndex || 100;
+options.resultHighlightLineWidth = options.resultHighlightLineWidth || 2;
var ResultGeometryList = function(){
//store a callback for the function to call when a row is clicke
@@ -165,30 +171,7 @@
resultHighlight.add(feature, options.resultHighlightColor);
resultHighlight.paint();
- }).mouseover(function () {
- // go up to the row, which has the "modelindex" set
- var i = $(this.parentNode.parentNode).data("modelindex");
- var feature = me.model.getFeature(i);
-
- if (options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > options.maxHighlightedPoints) {
- feature = feature.getBBox4();
- }
-
- resultHighlight.add(feature, options.resultHighlightColor);
- resultHighlight.paint();
- }).mouseout(function () {
- // go up to the row, which has the "modelindex" set
- var i = $(this.parentNode.parentNode).data("modelindex");
- var feature = me.model.getFeature(i);
-
- if (options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > options.maxHighlightedPoints) {
- feature = feature.getBBox4();
- }
-
- resultHighlight.del(feature, options.resultHighlightColor);
- resultHighlight.paint();
- });
-
+ })
// set style of cursor to pointer for the result table
$("tr td span.wfsFproperty",me.table).css("cursor","pointer");
@@ -227,7 +210,6 @@
//var table = $('<table class="display" id="'+ options.id +'_table"><thead><tr></tr></thead><tbody></tbody></table>');
//$('#'+options.id).append(table);
-
ResultGeometryList.prototype = new ResultGeometryListController(options);
ResultGeometryList.prototype.constructor = ResultGeometryList;
Modified: trunk/mapbender/lib/resultGeometryListController.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListController.js 2009-12-16 08:49:03 UTC (rev 5192)
+++ trunk/mapbender/lib/resultGeometryListController.js 2009-12-16 09:10:01 UTC (rev 5193)
@@ -77,9 +77,42 @@
// this is ok because we only added a single row
var rowNode = me.datatable.fnGetNodes(index[0]);
$(rowNode).data("modelindex",modelIndex);
+
+ var resultHighlight = new Highlight(
+ me.options.target,
+ "resultListHighlight",
+ {"position":"absolute", "top":"0px", "left":"0px", "z-index":me.options.resultHighlightZIndex},
+ me.options.resultHighlightLineWidth
+ );
+ $(rowNode).mouseover(function () {
+ var i = $(this).data("modelindex");
+ var feature = me.model.getFeature(i);
+
+ if (me.options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > me.options.maxHighlightedPoints) {
+ feature = feature.getBBox4();
+ }
+
+ resultHighlight.add(feature, me.options.resultHighlightColor);
+ resultHighlight.paint();
+ }).mouseout(function () {
+ var i = $(this).data("modelindex");
+ var feature = me.model.getFeature(i);
+
+ if (me.options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > me.options.maxHighlightedPoints) {
+ feature = feature.getBBox4();
+ }
+
+ resultHighlight.del(feature, me.options.resultHighlightColor);
+ resultHighlight.paint();
+ });
+
+
+
+
$(rowNode).click((function(){
var i = $(this).data("modelindex");
}));
+
}
};
More information about the Mapbender_commits
mailing list