[Mapbender-commits] r3797 - branches/2.6/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Mar 20 10:31:04 EDT 2009
Author: astrid_emde
Date: 2009-03-20 10:31:03 -0400 (Fri, 20 Mar 2009)
New Revision: 3797
Modified:
branches/2.6/http/javascripts/mod_highlightPOI.php
Log:
changes caused by new architecture mapframe as div
Modified: branches/2.6/http/javascripts/mod_highlightPOI.php
===================================================================
--- branches/2.6/http/javascripts/mod_highlightPOI.php 2009-03-20 14:29:57 UTC (rev 3796)
+++ branches/2.6/http/javascripts/mod_highlightPOI.php 2009-03-20 14:31:03 UTC (rev 3797)
@@ -124,25 +124,29 @@
function mod_highlightPOI_draw(){
- var ind = getMapObjIndexByName(mod_highlightPOI_target);
- var div = new DivTag(mod_highlightPOI_target+'permanent', mb_mapObj[ind].frameName,
- {
- "position":"absolute",
- "width":mb_mapObj[ind].width+"px",
- "height":mb_mapObj[ind].height+"px",
- "top":0,
- "left":0,
- "width":0,
- "height":0,
- "visibility":"visible"
- });
- var tagSource = "";
- for(var i=0; i<mod_highlightPOI_params.length; i=i+3){
- var pos = makeRealWorld2mapPos(mod_highlightPOI_target,mod_highlightPOI_params[i+1], mod_highlightPOI_params[i+2]);
- tagSource += "<div style='z-index:13;position:absolute;left:"+(pos[0]-Math.round(0.5*poi_width))+"px;top:"+(pos[1]-Math.round(0.5*poi_height))+"px'>";
- tagSource += "<img src='"+poi_image+"'>";
- tagSource += "<span style='"+poi_style+"'>"+mod_highlightPOI_params[i]+"<span>";
- tagSource += "</div>";
- }
- div.write(tagSource);
+ var mapObject = getMapObjByName(mod_highlightPOI_target);
+ var map_el = mapObject.getDomElement();
+ if (!map_el.ownerDocument.getElementById(mapObject.elementName + "_permanent")) {
+ //create Box Elements
+
+ var $div = parent.$("<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));
+ }
+
+ var tagSource = "";
+ for (var i = 0; i < mod_highlightPOI_params.length; i = i + 3) {
+ var pointFromUrl = new Point(parseFloat(mod_highlightPOI_params[i+1]), parseFloat(mod_highlightPOI_params[i+2]));
+ var pos = mapObject.convertRealToPixel(pointFromUrl);
+ 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+"'>";
+ tagSource += "<span style='"+poi_style+"'>"+mod_highlightPOI_params[i]+"<span>";
+ tagSource += "</div>";
+ }
+ $("#" + mapObject.elementName + "_permanent").html(tagSource);
}
More information about the Mapbender_commits
mailing list