Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using ESRI silverlight. I have graphic objects on the screen and each graphic object has an attached silverlight label. What I want to do is to have each label shown at a fixed screen (pixel) distance from graphic object. This seems not possible as esri draws the labels according to the envelope given in map coordinates.

Is there an easy way to show labels at fixed screen coordinates, not in map coordinates?

share|improve this question

This post at Sharp GIS blog shows how to work with custom cursors, perhaps this would apply to your use case too.

share|improve this answer

You can add the labels manually using TextBlocks to the same panel as the map. You might need to set the Canvas.Top, Canvas.Left, and Canvas.ZIndex. Remember all panels inherit from Canvas. Just iterate over each of the graphics in your collection and use the MapToScreen method on the map object to convert a vertice's MapPoint into a screen coordinate.

You can find more information on the Map.MapToScreen method on the esri silverlight api page.

Look under ESRI.ArcGIS.Client Assembly -> ESRI.ArcGIS.Client -> Classes -> Map -> Methods -> MapToScreen

You can read about how to use the canvas control on the MSDN page.

share|improve this answer

you could always create another graphic and manually set the label text. In the javascript api you can use a graphic TextSymbol. I'll check the silverlight API and see if it has the same

There is in the silverlight api which could help you out. It's super easy with points as you already have the spot where you want to put the label anchor. If it's lines/polygons you can use the geometry service's label points method to get the label location.

Here's another javascript example but you get the point.

share|improve this answer
Thanks for the response, but the problem is that, textsymbol does not have a background color property. In fact I have the same problem while using other symbols than marker symbols. when user focuses to map, their size changes. – daryal Apr 28 '11 at 13:04
@daryal this doesn't sound related to the question that was asked. – Steve May 3 '11 at 15:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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