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
Hi,
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.
-Graham
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.