Thanks for your post, I think you will be familiar with our MapSuite, everyone is from beginner to expert.
Your problem is caused that you didn’t set the correct PointStyle, if you want to show point, not just set point type and symbol type, you also need to set the color of brush, otherwise MapSuiteCore doesn’t know which color you want to draw point, so just add the following code you can see the red points after you call drawOnMap. pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolSolidBrush.Color = GeoColor.SimpleColors.Red
Please let me know if you have more questions. Thanks James
I tried what you said but nothing happened. Moreover i tried to insert an image instead of a symbol.
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType = PointType.Bitmap pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.Image = New GeoImage("C:\MapData\icons\user.jpeg")
Still nothing. Is there any chance there is a problme with the coordinates translation? The geographical coordinates system? This is the link from which i acquired the longitude and latitude values itouchmap.com/latlong.html
Because you said you can confirm the points are valid decimal values and within the map, so I use any points inside the current extent of map to test, they’re working if add that code.
So I think maybe the problem is caused by points coordinates, could you check each of them and let me know if they are within the current extent of map RectangleShape(22.835, 41.2921, 25.8892, 40.4029)? Or you can list some of the points’ coordinates and I can test them?
We have a Code Community project Dragging Icon (advanced) that deals with various aspects of icons. Please, take a look at that and see what you think.
Following HowDoI samples provided with our package are doing exactly what you are requesting, just take a look if you are interested. HowDoI\Styles\Use predefined geographic and standard colors HowDoI\Feature Layers\ Change the look of a feature layer.
Yes i have seen these samples. My question is whether i can change only one feature’s icon when this will be clicked. Or do i have to create another feature layer (thus deifferent style) which will hold that one feature which will be a replicate of the original??
I want to have a feature layer. Everything is exactly the same for each feature of course but there are 15 color variations. Do i need to create one layer for each color?? Moreover the features should changes colors. Do i have to remove them from one featureLayer and add them to the other? And i need to be able to search for one feature by id…If i have 10 layers i would need to search in all of them. Right?
You don't have to create a new layer to display differently some features from others. I don't know what kind of data you have, but for example, you could use the ValueStyle to display based on a column value see the sample "Draw features based on values" in the Styles category of the "How Do I" samples. Or it could be based on what value range using the ClassStyle, see "Draw thematic features" for that. Actually, we have a very flexible and extensible way to display feratures based on any criteria. For example, I would also check some projects in the Code Community that show how to extent Styles.
You can check those projects below,. They show some very customized way to extent Style but I think you will see how you can adapt that for your situation:
Nope, those examples were not helpful. At least not clear enough
I have one feature layer with many feature. At some point, while the program runs, the user selects one feature. i want that ONE of the features to change color. or icon.
//Spatial query to find the features intersecting the rectangle from the track rectangle. Collection<Feature> spatialQueryResults; worldLayer.Open(); //spatialQueryResults = worldLayer.QueryTools.GetFeaturesIntersecting(rectangleShape,ReturningColumnsType.NoColumns); spatialQueryResults = worldLayer.QueryTools.GetFeaturesContaining(pointShape, ReturningColumnsType.NoColumns); worldLayer.Close();
//Adds the selected features to the InMemoryfeatureLayer spatialQueryResultLayer.Open(); spatialQueryResultLayer.EditTools.BeginTransaction(); spatialQueryResultLayer.InternalFeatures.Clear(); foreach (Feature feature in spatialQueryResults) { spatialQueryResultLayer.EditTools.Add(feature); } spatialQueryResultLayer.EditTools.CommitTransaction(); spatialQueryResultLayer.Close();
//Refreshes the layers to show new result. winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear(); winformsMap1.Refresh(winformsMap1.TrackOverlay); winformsMap1.Refresh(winformsMap1.Overlays["SpatialQueryResultOverlay"]); }
I need to mention that the solution I just presented is working only for polygon based layer. For a point or line based layer, the technique will be a little different and that would an issue pretty similar to what we can see in another post: gis.thinkgeo.com/Support/Discussion...fault.aspx. This is a post for the Web edition but the spatial querying logic is the same.
I let you know that we will post new Code Community projects specifically for the Desktop edition that show how to select the feature the user clicked on whether the layer is polygon, line or point based. Since this is a pretty popular request, this will be well presented for everybody to take advantage of in the Code Community.
There is a new Code Community project posted today on that subject. Notice that in this project, we are using the MapClick event instead of the TrackEnded event but the code is basically the same and this method works for selecting the feature the user clicked on regardless of their type (polygon, line or point based). You can check it out Get Feature Clicked On: code.thinkgeo.com/projects/show/featureclicked