Show Label in a specific Zoom Level

7/7/2012 8:25:46 AM
Total Posts 2

Show Label in a specific Zoom Level

Hello,

How to set the label in a specific zoom level?

7/8/2012 2:08:56 AM
MVP
Total Posts 323

Re: Show Label in a specific Zoom Level

There are the LabelMinScale / LabelMaxScale properties:

layer.LabelMaxScale = map.ToScale(zoomLevel);

7/9/2014 7:01:32 AM
Total Posts 28

Re: Show Label in a specific Zoom Level

but, how to make only labels in a layer visible at specific zoom level.

7/9/2014 8:28:07 AM
MVP
Total Posts 323

Re: Show Label in a specific Zoom Level

Try to set LabelMinScale / LabelMaxScale both to the same scale value.

7/9/2014 9:02:12 AM
Total Posts 28

Re: Show Label in a specific Zoom Level

both not working... :(

actually I have a layer that shows locations and their name on map.., and i want to show that names of location only beyond centain zoom level, for better look and feel

plz help me.....:)

7/9/2014 11:04:54 AM
MVP
Total Posts 323

Re: Show Label in a specific Zoom Level

Look at the MapTutorial.aspx.cs sample, the AddDatabase method. The following code lets you show labels only if scale is less than 15000000:

dbLayer.ShowLabels = true;
// dislpay the labels when MapScale is less than 15000000
dbLayer.LabelMaxScale = 15000000;

To show labels up to 15000000 use the LabelMinScale:

dbLayer.LabelMinScale = 15000000;

 

7/10/2014 1:06:45 AM
Total Posts 28

Re: Show Label in a specific Zoom Level

bro...., 

i have tried this

layer.ShowLabels = true;

layer.LabelMaxScale = 72223; or layer.LabelMinScale = 72223;

but not working..,

7/10/2014 2:53:26 AM
MVP
Total Posts 323

Re: Show Label in a specific Zoom Level

I would suggest you to explore the AspMap samples that use these properties.
See the MapCaching.aspx.cs sample etc.