[mapguide-users] Session Extents

Scott Hameister ScottH at mPower-tech.com
Sun Mar 4 02:10:47 EST 2007



I found a way to get the current Last map view calls Extents..I'm not the
most efficient programmer so PLEASE no cutting on the code
Granted this is coldfusion code but it should be interpretable by most
programmers	(LL=LowerLeft & UR=UpperRight)
<cfset DPI = map.GetDisplayDpi()>
	<cfset metersPerPixel = 0.0254 / DPI>
	<cfset SesMapScale = map.GetViewScale()>
	<cfset SesScrnW = map.GetDisplayWidth()>
	<cfset SesScrnH = map.GetDisplayHeight()>
	<cfset MidX = map.GetViewCenter().GetCoordinate().getX()>
	<cfset MidY = map.GetViewCenter().GetCoordinate().getY()>
	<cfset SesLLX = Midx -((SesMapScale * SesScrnW  * metersPerPixel) /
metersPerUnit)/2>
	<cfset SesURX = ((SesMapScale * SesScrnW  * metersPerPixel) /
metersPerUnit)/2 + MidX>
	<cfset SesLLY = MidY - ((SesMapScale * SesScrnH  * metersPerPixel) /
metersPerUnit)/2>
	<cfset SesURY = ((SesMapScale * SesScrnH  * metersPerPixel) /
metersPerUnit)/2 + MidY>

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Scott Hameister
Sent: Friday, March 02, 2007 2:49 PM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Session Extents

Same extent as MapExtent




More information about the mapguide-users mailing list