Hi,
I want a code that show points with a query.
for example, i want to show cities(points) where population >200 000 .
Please can anyone help me ?
Thanks
Hi,
I want a code that show points with a query.
for example, i want to show cities(points) where population >200 000 .
Please can anyone help me ?
Thanks

The easiest way is to use a feature layer with a where clause (sample).
You can also manage the query by yourself, see others query samples.
/Dominique
Thank you dominique,
how can i use a feature with a where clause ??
and for query samples....i dont find a query about a feature layer (point)...i found just for polygons !!
can you give me an example of a query ?

Did you look at the sample I pointed out?how can i use a feature with a where clause ??
In this sample, the feature layer is defined in XAML with a where clause:
Code:<esri:FeatureLayer ID="AttributeFilterFeatureLayer" Url="http://sampleserver1.arcgisonline.co...SA/MapServer/0" Where="POP1990 > 1000000" Renderer="{StaticResource MySimplePointRenderer}" > </esri:FeatureLayer>
There is not that much difference between polygon and point, you have just to replace the fill symbol by a marker symbol.and for query samples....i dont find a query about a feature layer (point)...i found just for polygons !!
For example in this sample, the impacted lines are:
Code:// Highlight selected feature selectedFeature.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol; graphicsLayer.Graphics.Add(selectedFeature);
/Dominique
Thank you,
its a good idea to use a feature layer with a where clause , but i want that the user who tape the condition (clause where).
for example i want that the user have a textbox and he enter the condition ...any idea ?

Sure, you can subscribe to TextBox.KeyUp event (Key.Enter) or maybe on a Button.Click event, you can set Where clause by using the Text value.
For example;
Code:var l = MyMap.Layers["MyFeatureLayer"] as FeatureLayer; l.Where = string.Format("FieldName = '{0}'", MyTextBox.Text); l.Update(); //to re-query the service applying the where clause.
Jennifer Nery
Software Developer
ArcGIS API for SL/WPF/WP7
Thank you too much,
i will try it
Bookmarks