[mapguide-users] Lat Long Display Issue/Bug

Andy Morsell amorsell at spatialgis.com
Wed Mar 15 16:48:21 EST 2006


Thanks for the tip, Kori.  As for my below described potential work-around,
I just tried it with the DWF viewer (I've been exclusively using the AJAX
viewer) and the selection does not work.  It works fine with the AJAX
viewer, however.  I'll track that one down some day.......


Andy 

-----Original Message-----
From: Kori Maleski [mailto:km at pat.ca] 
Sent: Wednesday, March 15, 2006 1:01 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Lat Long Display Issue/Bug

Thanks Andy,

If I call a ZoomToView after the SetSelectionXml it works fine.

I send my well formed XML with the String.Format function.  As long the
parameter {0} is enclosed with single quotes '{0}' it works no problem.

i.e.

Dim l_sJavascript As String = String.Format("ZoomSelection( {0}, {1},
'2000', '{2}' );", l_oMGCoordinateXY.GetX(), l_oMGCoordinateXY.GetY(),
selectionXML)

Then register it as a startupscript...







Kori Maleski  BSc. 
Senior Technical Consultant
 

 
Suite 400 - 534 17 Ave. SW Calgary, AB CANADA T2S 0B1 TEL
403.770.1917
 
 
FAX
877.691.9149
 TOL
877.691.9171
www.pat.ca
 

-----Original Message-----
From: Andy Morsell [mailto:amorsell at spatialgis.com]
Sent: March 15, 2006 1:44 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Lat Long Display Issue/Bug

It definitely sounds like something funky with SetSelectionXml.  When I
first did this, I was trying to use SetSelectionXml and had some issues
getting it to accept my programatically formed XML.  So, I ended up doing
things a bit differently.  Since I was already having to get a FeatID for an
object based on another field, I then have the program create a new
MgSelection, add my object to it using the AddFeatureIdInt32 method, then
Save it.  This way you don't have to mess with passing well-formed XML from
server to client.  If you then use ZoomToView after this, it will zoom to
that location and use the selection that has been saved on the server when
the view is refreshed.

Perhaps something similar will help you work around the problem.


Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

-----Original Message-----
From: Kori Maleski [mailto:km at pat.ca]
Sent: Wednesday, March 15, 2006 12:27 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Lat Long Display Issue/Bug

Hi Andy,

If I fire XML to the SetSelectionXML function, it selects the parcel, and
zooms to latlong coordinates in the XY projection.

So instead of X 100000 Y 1000000, it says X -122.000 Y 48.00000.  Note the
XYs.  So the map ends up in the far left lower corner of the map.

I am not calling any zoom function when I am doing this.  

...


If I fire the SetSelectionXML function, then the ZoomToView function
followed by a Refresh - it will select and end up in the correct place.

The ZoomToView function in this case is being passed projected coordinates.


Is my SetSelectionXML doing something funky?






Kori Maleski  BSc. 
Senior Technical Consultant
 

 
Suite 400 - 534 17 Ave. SW Calgary, AB CANADA T2S 0B1 TEL
403.770.1917
 
 
FAX
877.691.9149
 TOL
877.691.9171
www.pat.ca
 

-----Original Message-----
From: Andy Morsell [mailto:amorsell at spatialgis.com]
Sent: March 15, 2006 1:14 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Lat Long Display Issue/Bug

 I have some similar custom programming, but no coordinate transformation,
and setSelectionXml does not zoom to the selection automatically.  If you
alert your x and y coordinates being passed to ZoomToView, are they
pre-projected or post-projected?  It's odd that you can get to it work when
SetSelectionXml is not involved since the selection does not have a
coordinate element, only elements for the layer and the object (via the
internal feature ID).


Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

-----Original Message-----
From: Kori Maleski [mailto:km at pat.ca]
Sent: Wednesday, March 15, 2006 11:57 AM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Lat Long Display Issue/Bug

Thanks Alain,

Here is the real bug then:

Map is projected.
Washington State Plane NAD27 North (ft)

Data is geographic WGS 84

I have a ZoomToView function that reads from a point database with LatLong
columns.

I use the MGProjection/Factory etc. to translate these point positions to
the proper projection.

Send the new coordinates to the ZoomToView.

Works like a charm.


Now:

I want to pass my selection in XML to the SetSelectionXML.
I create an MGSelection object querying a LatLong Parcel Layer in the
Projected Map.

Passes it...

It then selects my feature and zooms to a LatLong position on the XY
projected map (somewhere far far away.

So. 2 Questions:

Does the SetSelectionXML function zoom to its selection automatically?

Why is it zooming to latlong coordinates when the map is projected?



I believe this is a serious bug, unless I am out to lunch somehow...





Kori Maleski  BSc. 
Senior Technical Consultant
 

 
Suite 400 - 534 17 Ave. SW Calgary, AB CANADA T2S 0B1 TEL
403.770.1917
 
 
FAX
877.691.9149
 TOL
877.691.9171
www.pat.ca
 

-----Original Message-----
From: Alain Lebatard [mailto:alain.lebatard at autodesk.com]
Sent: March 15, 2006 12:32 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Lat Long Display Issue/Bug

Hi Kori,

This is a bug that only affects the display of the coordinates. The order of
the parameters in the ZoomToView function has always the same meaning,
regardless of the display settings, so do not switch the Lat and Lon values
in the call to this API.

Alain

-----Original Message-----
From: Kori Maleski [mailto:km at pat.ca]
Sent: Wednesday, March 15, 2006 10:05 AM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Lat Long Display Issue/Bug


Hi All,

I have a map that I am displaying in Washington State Plane NAD27 North
(ft)
projection and the DWF viewer is switching the Lat for Lon in the coordinate
display.  

Anyone else see this?  Does this mean we have to switch them for the
ZoomToView function as well?

Cheers,



Kori Maleski  BSc. 
Senior Technical Consultant
 

 
Suite 400 - 534 17 Ave. SW Calgary, AB CANADA T2S 0B1 TEL
403.770.1917
 
 
FAX
877.691.9149
 TOL
877.691.9171
www.pat.ca
 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: users-help at mapguide.osgeo.org








More information about the Mapguide-users mailing list