0

I'm using Silverlight plugin 5.1.3 and I'm trying to create a rectangular polygon graphic based on a mappoint. For simplicity reasons, lets assume the maps spatial reference is Web Mercator WGS84 and the rectangle is 1 Meter by 2 Meters.

How can I go about this?

closed as off-topic by PolyGeo Dec 6 '17 at 21:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • did you mean Web Mercator as the coordinate system? – DPSSpatial Aug 18 '14 at 18:39
  • Yes, sorry. Web Mercator WGS84 – DaBears Aug 18 '14 at 18:44
1

I needed something similar. What I did was:

  1. Created a in xaml and linked its Points value to a PointCollection variable in my model and the Visibility with another one.
  2. Then at the mouseclickevent, I get the e.GetPosition which gives you screen coordinates of you mouse.

From here, you can calculate your coners in screen coordinates, but I needed them in my coordinate system. So I did:

  1. Via mainpage.ScreenToMap(screenPoint) you can convert it to a MapPoint with a specific spatial reference system.
  2. From this point, you can calculate your corners (easier with projected reference system so you could use meters)
  3. Save you corners as screen points in the System.Windows.Media.PointCollection variable and control the visibilty of your polygon with the visibility variable.
  • Created a in xaml and linked its Points created a what? the sentence doesn't make sense – nmtoken Nov 8 '16 at 23:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.