Hi Guys
I am having some issues displaying a point layer. No matter what I try, the symbols for the layer are just tiny dots in the map. Additionally the hover over highlighting seems to be acting extremely odd. What happens is that when I move the mouse the point that is highlighted is usually no where near the cursor and some map elements are not able to be highlighted.
It seems that the map is creating large symbols for the points, these are overlapping each other, but the map is not drawing them. At least that is my guess. I have tried playing with SymbolSize and some other attributes but I just cant seem to get it right.
Im sure its something simple that I have just missed.
The Xaml Map definition is below
<igMap:XamMap x:Name="theMap" Initialized="theMap_Initialized" HorizontalAlignment="Left" GridDisplayMode="None" ElementClick="theMap_ElementClick" Background="{x:Null}" Foreground="{x:Null}" ViewportBorderBrush="{x:Null}" ViewportBackground="{x:Null}"> <igMap:MapLayer SymbolType="Bubble" DataContext="{Binding}" LayerName="DropLocations"> <igMap:MapLayer.Reader> <igMap:SqlShapeReader DataMapping="Data=Geom;Id=liEventKey;" /> </igMap:MapLayer.Reader> </igMap:MapLayer> </igMap:XamMap.Layers> <igMap:MapNavigationPane Margin="10" igControls:XamDock.Edge="InsideRight" /> </igMap:XamMap>
The data is being set as per below
ObservableCollection<vwLocationWithWKTGeom> geoms = ((LocationRepository)theMap.Layers["ROMPAD"].DataContext).FindAllSpatialLocations; SqlShapeReader sqlReader = theMap.Layers["ROMPAD"].Reader as SqlShapeReader; if (sqlReader != null) { sqlReader.DataSource = geoms; theMap.Layers["ROMPAD"].ImportAsync(); }
where the Geom column is a Well known text field a couple of examples below
POINT(40.8559 20.9835)
POINT(42.6019 -31.2075)
I've opened a support ticket on your behalf with a reference number CAS-50715-SSMR49Y so we can continue discussing this issue.
Awsome.
how do i access that ticket? i had a look in "My support activities" but there is nothing there. any directions would be nice
cheers
I've just updated you on the ticket. It should be visible now in "My Support Activities" page.
Hi,
If you could provide a bit more info it will help us track down your problems. Is there a projection applied to the point data? If so, which one? Are you overlaying this point layer on another layer? Are the projections the same?
There's some info I can provide thusfar, and Vlad communicated to me a bit more info than in your post here, so I'll try to speak to that too.
The SymbolElements read from WKT currently default to size 1 and the SymbolSize of the layer doesn't propagate. This smells like a bug to me, so I'll get back to you with a bug number. In the meantime, you can set the SymbolSize for the points like this:
private void pointLayer_Imported( object sender, MapLayerImportEventArgs e) { if (e.Action == MapLayerImportAction.End) { foreach (SymbolElement s in (sender as MapLayer) .Elements.OfType<SymbolElement>()) { s.SymbolSize = 10; } } }
If I overlay the point data you sent Vlad on a world map, I get this:
Are these points in the right place based on that data (that you sent Vlad), if not it could be a case of the projection of that data not matching the projection of the rest of the map.
-Graham
I'm pretty sure this is a bug. Have you provided a sample project to developer support? We can open up a bug on it, until then the aforementioned workaround should avoid the issue.
ohh yeah, forgot to mention, that we add the point layer sql reader just after we load in the data into the polygon data.
That seems to be whats happening, we have 2 layers "PointsLyr" and "PolyLyr" we load the poly's on start up. but the points dont get loaded untill much later when the user does some criteria selection. When we had a SQL Reader on the points layer it would obscure the polygon layer completely or something. No map grid lines showing up or anything like that.
When i removed the SQL Reader from the points layer and added it later in code it all worked perfectly
OfType<T> is a linq operator implemented as an extension method on IEnumerable. If you add "using System.Linq" to the top of your file then the code will compile. Its a more concise way of putting a type filter on the enumeration.
As to the other issue, I'm not sure what might be going on there. It could be that the layer isnt being loaded rather than being obscured. If you call an ImportAsync on the non-visible layer from the Imported event of the layer that is shown, does it make the other show up?
If you can provide a sample that replicates the blank layer, I can delve into it a bit. I think there could be some odd behaviors with the SqlShapeReader, if it doesnt have data assigned, and cancels and import, it could cause the map to stop trying to import the other layers until you call ImportAsync on a layer to start the process up again.
ok i think ive got that worked out. It looks like if i have a SQLReader defined in the point layer in XAML it wont show the polygon. I removed it from the XAML and added it in code. this seems to work.