Re: [Shapedotnet-development] Layer Visibility Range
Status: Beta
Brought to you by:
k5jvc
From: John C. <jo...@k5...> - 2004-01-18 04:50:40
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <title></title> </head> <body text="#000000" bgcolor="#ffffff"> Layer visibility thresholds became a hot topic with a previous project I was a part of. The trouble is, what units of measurement do you use to toggle a layers visibility? I see that you're using a percentage in your example, but is that a percentage of the viewport as compared to extents of the map, or the map layer? While we're considering it, is that a percentage of area coverage or a percentage of total map features, or a percentage of layer features? Area will probably provide the least performance hit to calculate, but then you run into the issue of one layer being in a lat/lon format and a second layer in the map being projected in feet or meters or...<br> <br> I think trying to make this work at the GIS namespace level is a recipe for headaches, it's too application specific. Best to provide some sort of metric that represents the current "zoom level" or scale as a property of the Map object and let the application developer determine how to handle it. We could even go one step further and raise a custom event like OnScaleChange or some such.<br> <br> I know this looks like a simple issue, but I've been bit before and I could never get the solution generic enough to work correctly in all situations. Of course I don't claim to be the sharpest pencil in the drawer and I never say never, someone else may have a workable generic solution. I love reading code. :)<br> <br> John<br> <br> Rife, Ryan wrote:<br> <blockquote type="cite" cite="mid...@or..."> <meta http-equiv="Content-Type" content="text/html; "> <meta name="Generator" content="Microsoft Word 11 (filtered medium)"> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style> <div class="Section1"> <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I’m not sure if this needs to be part of SDN or the parent application or if it already exists, but the application I am working needs to be able to set the layer’s visibility based on far in the user has zoomed into the map. For example if a layer could have a visibility range of 20%-50% so when 50% or less of the map is visible then the layer is automatically turned on….if the map is only 20% visible or goes more than 50% visible then the layer would automatically turn off. Later.<o:p></o:p></span></font></p> <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p> <p class="MsoNormal"><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Ryan Rife<o:p></o:p></span></font></p> </div> </blockquote> </body> </html> |