[Mapbender-commits] r4997 - branches/2.6/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Nov 16 10:24:35 EST 2009
Author: mschulz
Date: 2009-11-16 10:24:35 -0500 (Mon, 16 Nov 2009)
New Revision: 4997
Added:
branches/2.6/http/javascripts/mod_permanentHighlight.php
Log:
rewrite from permanentHighlight.js, to comply with new mapframe div
Added: branches/2.6/http/javascripts/mod_permanentHighlight.php
===================================================================
--- branches/2.6/http/javascripts/mod_permanentHighlight.php (rev 0)
+++ branches/2.6/http/javascripts/mod_permanentHighlight.php 2009-11-16 15:24:35 UTC (rev 4997)
@@ -0,0 +1,100 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_permamentHighlight.php
+# Copyright (C) 2009 OSGeo
+#
+# 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_validateSession.php");
+
+echo "var mod_permanentHighlight_target = '".$e_target[0]."';";
+
+include('../include/dyn_js.php');
+
+?>
+try{
+ if (poi_image){}
+}
+catch(e){
+ poi_image = '../img/redball.gif';
+}
+
+try{
+ if (poi_width){}
+}
+catch(e){
+ poi_width = 14;
+}
+
+try{
+ if (poi_height){}
+}
+catch(e){
+ poi_height = 14;
+}
+
+try{
+ if (poi_style){}
+}
+catch(e){
+ poi_style = 'background-color:white;font-weight: bold;color:black;font-family:Arial;';
+}
+
+eventAfterMapRequest.register(function () {
+ mod_permanentHighlight_draw();
+});
+
+var mod_permanentHighlight_x = false
+var mod_permanentHighlight_y = false;
+var mod_permanentHighlight_text = false;
+
+function mod_permanentHighlight_init() {
+ /* no need to call this function anymore */
+}
+
+function mod_permanentHighlight_hide(){
+ var mapObject = parent.getMapObjByName(mod_permanentHighlight_target);
+ $("#" + mapObject.elementName + "_permanent").empty();
+}
+
+function mod_permanentHighlight_draw(){
+ var mapObject = getMapObjByName(mod_permanentHighlight_target);
+ var map_el = mapObject.getDomElement();
+ if (mod_permanentHighlight_x && mod_permanentHighlight_y){
+ var pointFromUrl = new Point(parseFloat(mod_permanentHighlight_x), parseFloat(mod_permanentHighlight_y));
+ var pos = mapObject.convertRealToPixel(pointFromUrl);
+ var tagSource = "";
+ tagSource += "<div style='z-index:13;position:absolute;left:"+(pos.x- Math.round(0.5*poi_width))+"px;top:"+(pos.y-Math.round(0.5*poi_height))+"px'>";
+ tagSource += "<img src='"+poi_image+"'>";
+ if (mod_permanentHighlight_text != "") {
+ tagSource += "<span style='"+poi_style+"'>"+mod_permanentHighlight_text+"<span>";
+ }
+ tagSource += "</div>";
+
+ var map_el = mapObject.getDomElement();
+ if (!map_el.ownerDocument.getElementById(mapObject.elementName + "_permanent")) {
+ //create Box Elements
+ var $div = $("<div id='" + mapObject.elementName + "_permanent'><img src='../img/redball.gif'/></div>");
+ $div.css({
+ position: "absolute",
+ top: "0px",
+ left: "0px",
+ zIndex: 13
+ });
+ map_el.appendChild($div.get(0));
+ }
+ $("#" + mapObject.elementName + "_permanent").html(tagSource);
+ }
+}
Property changes on: branches/2.6/http/javascripts/mod_permanentHighlight.php
___________________________________________________________________
Added: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
More information about the Mapbender_commits
mailing list