The "GetSpatialExtent" method is new, so you have to use the MaestroAPI.dll from thre preview binaries or grab them from the folder where you installede Maestro.

The SpatialContext is likely to contain wrong information (eg, just extent of the entire coordinate system).

Regards, Kenneth Skovhede, GEOGRAF A/S



ravinder.si...@birlasoft.com skrev:

Hi Kenneth,

I have gone thru the file you referred.

I have problem in Topology.Geometries.IEnvelope env = ldef.GetSpatialExtent(); at line no 1912

GetSpatialExtent() method is not coming in in ldef object I created.

And then I tried to write just the following code

OSGeo.MapGuide.MaestroAPI.LayerDefinition ldef = conn.GetLayerDefinition(mylayer.ResourceId);

//Topology.Geometries.IEnvelope env = ldef

OSGeo.MapGuide.MaestroAPI.FdoSpatialContextList lst = conn.GetSpatialContextInfo(ldef.Item.ResourceId, false);

mapDef.Extents.MinX = System.Convert.ToDouble(lst.SpatialContext[0].Extent.LowerLeftCoordinate.X);

mapDef.Extents.MinY = System.Convert.ToDouble(lst.SpatialContext[0].Extent.LowerLeftCoordinate.Y);

mapDef.Extents.MaxX = System.Convert.ToDouble(lst.SpatialContext[0].Extent.UpperRightCoordinate.X);

mapDef.Extents.MaxY = System.Convert.ToDouble(lst.SpatialContext[0].Extent.UpperRightCoordinate.Y);

Which gives me the incorrect coordinates, I verify it with maestro, it is different from that one showing in maestro, in effect the viewer also is not able to show the map.

*Thanks*

Ravinder

------------------------------------------------------------------------

*From:* mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Kenneth Skovhede, GEOGRAF A/S
*Sent:* Wednesday, February 18, 2009 3:35 PM
*To:* MapGuide Users Mail List
*Subject:* Re: [mapguide-users] Regarding How to set the Initial Map View

Please have a look at the Maestro code:
http://trac.osgeo.org/mapguide/browser/trunk/Tools/Maestro/Maestro/ResourceEditors/MapEditor.cs#L1895

It shows how to read the extent of data, as well as how to set it.


Regards, Kenneth Skovhede, GEOGRAF A/S



ravinder.si...@birlasoft.com <mailto:ravinder.si...@birlasoft.com> skrev:

Hi,

Although it solved out my problem of setting the initial map View at Design time in maestro.

Now I have written the code to set the layer of map dynamically by using maestro api, the map is showing correct layer in viewer. Now I want to set the Initial Map View (Lower Left and Upper Right (XY Coordinates)) at run time by fetching the extents of the layer.

Please assist...

*Thanks*

Ravinder

------------------------------------------------------------------------

*From:* mapguide-users-boun...@lists.osgeo.org <mailto:mapguide-users-boun...@lists.osgeo.org> [mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *ravinder.si...@birlasoft.com <mailto:ravinder.si...@birlasoft.com>
*Sent:* Tuesday, February 17, 2009 4:19 PM
*To:* mapguide-users@lists.osgeo.org <mailto:mapguide-users@lists.osgeo.org>
*Subject:* RE: [mapguide-users] Regarding How to set the Initial Map View

Hi Kenneth,

Yes it solved out my problem.

Thanks

Regards,

Ravi

------------------------------------------------------------------------

*From:* mapguide-users-boun...@lists.osgeo.org <mailto:mapguide-users-boun...@lists.osgeo.org> [mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Kenneth Skovhede, GEOGRAF A/S
*Sent:* Tuesday, February 17, 2009 1:38 PM
*To:* MapGuide Users Mail List
*Subject:* Re: [mapguide-users] Regarding How to set the Initial Map View

There was a bug in Maestro that swapped some x/y coordinates, try using the newest build (r3260).

Regards, Kenneth Skovhede, GEOGRAF A/S



ravinder.si...@birlasoft.com <mailto:ravinder.si...@birlasoft.com> skrev:

Hi All,

How to set the Initial Map View (Lower Left and Upper Right (XY Coordinates)) in MapGuide Maestro.

If I click on Set View to Current Layers Extent (In Maestro) & Run the layout then map does not appears in the viewer , seems that map is there on the viewer but at different position which is not visible at startup, Because when I try to pan the map multiple times left or right up or down it appears.

I am using MGOS 2.0, .Net

Please assist...

*Thanks,*

Ravi

*********************************************************************************************************************************************************************
"This message and any attachments are solely for the intended recipient and may contain Birlasoft confidential or privileged information. If you are not the intended recipient,any disclosure,copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail at (administra...@birlasoft.com <mailto:administra...@birlasoft.com>) and permanently delete this message and any attachments. Thank you."
*********************************************************************************************************************************************************************


------------------------------------------------------------------------


_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org <mailto:mapguide-users@lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapguide-users
*********************************************************************************************************************************************************************
"This message and any attachments are solely for the intended recipient and may contain Birlasoft confidential or privileged information. If you are not the intended recipient,any disclosure,copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail at (administra...@birlasoft.com <mailto:administra...@birlasoft.com>) and permanently delete this message and any attachments. Thank you."
*********************************************************************************************************************************************************************

*********************************************************************************************************************************************************************
"This message and any attachments are solely for the intended recipient and may contain Birlasoft confidential or privileged information. If you are not the intended recipient,any disclosure,copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail at (administra...@birlasoft.com <mailto:administra...@birlasoft.com>) and permanently delete this message and any attachments. Thank you."
*********************************************************************************************************************************************************************


------------------------------------------------------------------------


_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org <mailto:mapguide-users@lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapguide-users
********************************************************************************************************************************************************************* "This message and any attachments are solely for the intended recipient and may contain Birlasoft confidential or privileged information. If you are not the intended recipient,any disclosure,copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail at (administra...@birlasoft.com) and permanently delete this message and any attachments. Thank you."
*********************************************************************************************************************************************************************

------------------------------------------------------------------------

_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to