Attention of ArcGIS API for Silverlight lookup points

Source: Internet
Author: User
Tags silverlight

There are two main coordinate systems:

Wkid = 102100

Wkid = 4326

In addition, the width and height of a geometry object are 0, which requires special attention.

// Coordinate points to focus on ESRI. arcGIS. client. projection. webmercator Mercator = new ESRI. arcGIS. client. projection. webmercator (); ESRI. arcGIS. client. geometry. envelope selectedfeatureextent = Mercator. togeographic (graphic. geometry ). extent; // The Position of the last vertex; double expandpercentage = 30; double widthexpand = (selectedfeatureextent. width + 5) * (expandpercentage/100); double heightexpand = (selectedfeatureextent. height + 5) * (expandpercentage/100); ESRI. arcGIS. client. geometry. envelope displayextent = new ESRI. arcGIS. client. geometry. envelope (selectedfeatureextent. xmin-(widthexpand/2), selectedfeatureextent. ymin-(heightexpand/2), selectedfeatureextent. xmax + (widthexpand/2), selectedfeatureextent. ymax + (heightexpand/2); mymap. zoomto (displayextent );

double widthExpand = (selectedFeatureExtent.Width + 5) * (expandPercentage / 100);

Note that you can add 5 to each width to achieve this.

How to set the coordinate system:

 ESRI.ArcGIS.Client.Geometry.Envelope initialExtent =                    new ESRI.ArcGIS.Client.Geometry.Envelope(                _mercator.FromGeographic(                    new ESRI.ArcGIS.Client.Geometry.MapPoint(-122.4545596, 37.783443296)) as MapPoint,                _mercator.FromGeographic(                    new ESRI.ArcGIS.Client.Geometry.MapPoint(-122.4449924, 37.786447331)) as MapPoint);            initialExtent.SpatialReference = new SpatialReference(102100);  //WKID=4326            MyMap.Extent = initialExtent;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.