pthibault

ContentPane - getting correct map.extent

Discussion created by pthibault on Mar 29, 2013
I have an application with a mapDiv within a contentPane.  When I do a map.extent.....i seem to be getting the entire window instead of the area within the mapDiv in the contentPane.  This results in having my .toScreenGeometry calculation off by, in this case, 550 px.

I can put a fudge factor in (ie 550 px) but this is not the right solution.  The tooltips are calculating outside of the area where the map should be.  Any ideas of how to obtain the map extent within only the content pane.

function showpointResults(featureSet) {
          
      resultFeatures = featureSet.features;
        myx = featureSet.features[0].geometry.x;
   myy = featureSet.features[0].geometry.y;
   mypoint = new esri.geometry.Point(myx,myy,new esri.SpatialReference({ wkid:2260 }));

mymappoint = new esri.geometry.toScreenGeometry(map.extent, map.width, map.height, mypoint)

   closeDialog();
   var tipContent = "<b>PIN</b>: " + featureSet.features[0].attributes["PIN"];       
   var dialog = new dijit.TooltipDialog({     
   id: "tooltipDialog",         
   content: tipContent,         
   style: "position: absolute; width:100px ;font: normal normal bold 9pt Tahoma;z-index:100"       
   });       
   dialog.startup();       
   dojo.style(dialog.domNode, "opacity", 0.85);       

var screentooltip = new esri.geometry.toScreenGeometry(map.extent, map.width, map.height,featureSet.features[0].geometry);
dijit.placeOnScreen(dialog.domNode, {x: screentooltip.x + 550, y: screentooltip.y}, ["TR"], {x: 10, y: 10});
  
  }

Outcomes