[Mapbender-commits] r2272 - branches/nimix_dev/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Mar 19 12:29:53 EDT 2008
Author: nimix
Date: 2008-03-19 12:29:53 -0400 (Wed, 19 Mar 2008)
New Revision: 2272
Added:
branches/nimix_dev/http/javascripts/tooltip.php
Modified:
branches/nimix_dev/http/javascripts/core.js
branches/nimix_dev/http/javascripts/popup.js
Log:
tooltip demo modul
Modified: branches/nimix_dev/http/javascripts/core.js
===================================================================
--- branches/nimix_dev/http/javascripts/core.js 2008-03-19 16:29:11 UTC (rev 2271)
+++ branches/nimix_dev/http/javascripts/core.js 2008-03-19 16:29:53 UTC (rev 2272)
@@ -53,6 +53,11 @@
var eventInitMap = new MapbenderEvent();
/**
+ * Mousemove
+ */
+var eventMouseMove = new MapbenderEvent();
+
+/**
* Triggered after the map object has been created.
*/
var eventAfterMapObjectConstruction = new MapbenderEvent(); // possibly obsolete!
Modified: branches/nimix_dev/http/javascripts/popup.js
===================================================================
--- branches/nimix_dev/http/javascripts/popup.js 2008-03-19 16:29:11 UTC (rev 2271)
+++ branches/nimix_dev/http/javascripts/popup.js 2008-03-19 16:29:53 UTC (rev 2272)
@@ -112,6 +112,7 @@
*/
mb_popup.prototype.hide = function(){
$("#"+this.id).hide();
+ $("#balloon_"+this.id).hide();
}
/**
@@ -119,6 +120,7 @@
*/
mb_popup.prototype.destroy = function(){
$("#"+this.id).remove();
+ $("#balloon_"+this.id).remove();
}
/**
Added: branches/nimix_dev/http/javascripts/tooltip.php
===================================================================
--- branches/nimix_dev/http/javascripts/tooltip.php (rev 0)
+++ branches/nimix_dev/http/javascripts/tooltip.php 2008-03-19 16:29:53 UTC (rev 2272)
@@ -0,0 +1,48 @@
+<?php
+# $Id: mod_toggleModule.php 2238 2008-03-13 14:24:56Z christoph $
+# http://www.mapbender.org/index.php/mod_toggleModule.php
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
+echo "var tooltipTarget ='".$e_target[0]."';";
+?>
+var testttt=0;
+var tooltipWin=null;
+
+eventInit.register(function(){
+ console.log($("#mapframe1").length+"init");
+ $(window.frames["mapframe1"].document).mousemove(function(event){
+ eventMouseMove.trigger();
+ mb_getMousePos(event,"mapframe1");
+ }).mouseout(function(){testttt=0;});
+});
+
+eventMouseMove.register(function(){
+ if(tooltipWin&&tooltipWin.isVisible())
+ tooltipWin.destroy();
+ testttt++;
+ setTimeout("if(testttt=="+testttt+")showBalloon();",2000);
+});
+
+function showBalloon(){
+ x=clickX+parseInt(document.getElementById("mapframe1").style.left);
+ y=clickY+parseInt(document.getElementById("mapframe1").style.top);
+ if(tooltipWin&&tooltipWin.isVisible())
+ tooltipWin.destroy();
+ tooltipWin = new mb_popup({title:"Test Tooltip",width:200,height:120,balloon:true,left:x,top:y});
+ tooltipWin.show();
+}
More information about the Mapbender_commits
mailing list