Hoppa till huvudinnehållet

Coordinates from Event Layer

Kommentarer

5 kommentarer

  • Ryan Cooney

    Hi Aaron,

    If you create a MapPoint out of your X and Y and assign it a new SpatialReference using WKID 4326, you should be able to call ESIR.ArcGIS.Client.Projection.WebMercator.FromGeogaphic(...) to convert it to Web Mercator.

    (http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Projection.WebMercator~FromGeographic.html) http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Projection.WebMercator~FromGeographic.html

    --Ryan

    0
  • Permanently deleted user

    Ryan,

    I have the MapPoint created and have assigned .X, .Y and .SpatialReference (4326); however, I'm not following you on how to project to Web Mercator (102113) through Workflow.

    Thanks,

    Aaron

    0
  • Permanently deleted user

    Ryan,

    I followed the approach described in this post, https://support.geocortex.com/Forums/Thread.aspx?pageid=0&mid=2&ItemID=20&thread=45726&postid=132159, to re-project and the coordinates look good. The problem I am having now is zooming to the extent of the projected point using the following Value for the "SetMapExtent" activity: BridgeGeometry.Extent().expand(3); where BridgeGeometry is of type Geometry. The map doesn't seem to change extents.

    Thanks,

    Aaron

    0
  • Ryan Cooney

    Hi Aaron,

    The issue here is that the extent of a MapPoint has zero width and height. The map will not zoom to an extent with no size. The Expand(3) method just triples the width and height, so you are still left with zero size. You've got a couple options:

    1. You can pass your MapPoint into a BufferTask activity and buffer it by an actual distance (say 100 Meters) to get a Polygon. This will have an extent with a valid size that you can use.
    2. You could also just create a new extent from your MapPont by using an Assign activity with an expression like: 

    new Envelope(point.X - 100, point.Y - 100, point.X + 100, point.Y + 100)

    --Ryan

    0
  • Permanently deleted user

    Ryan,

    I went with option two and everything is working as expected now. Thanks, for clarifying the issue and providing two solutions.

    Aaron 

    0

Du måste logga in om du vill lämna en kommentar.