How can I use GeoJson to draw Polygon by coordinates in a in WPF xamMap
the GeoJson Format is like this
{ "type": "Feature", "properties": { "POSTNR_TXT": "2400", "POSTBYNAVN": "København NV" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 12.507469981824794, 55.697642162728606, -999.0 ], [ 12.513470122147424, 55.704428732464073, -999.0 ], [ 12.516776939745267, 55.704245855645013, -999.0 ], [ 12.511408705114711, 55.708960962304033, -999.0 ], [ 12.512190041441698, 55.711319645986919, -999.0 ], [ 12.507081679280693, 55.710984380633825, -999.0 ], [ 12.500766360708445, 55.716490781902046, -999.0 ], [ 12.500985311351469, 55.720444029925297, -999.0 ], [ 12.513211464550546, 55.719649477195055, -999.0 ], [ 12.514651499558028, 55.722689456470626, -999.0 ], [ 12.515294107031444, 55.722867782463666, -999.0 ], [ 12.519599152820591, 55.727566179811724, -999.0 ], [ 12.521429690746064, 55.728193692183275, -999.0 ], [ 12.527186067082091, 55.726885261036692, -999.0 ], [ 12.53516392512655, 55.727108311290323, -999.0 ], [ 12.538297517729665, 55.726441897451792, -999.0 ], [ 12.539753549623979, 55.72373406410744, -999.0 ], [ 12.54589448194818, 55.722725109856434, -999.0 ], [ 12.541971137748702, 55.718870330709052, -999.0 ], [ 12.546457224964172, 55.712452149815277, -999.0 ], [ 12.544526324718129, 55.707857018746353, -999.0 ], [ 12.536143185683914, 55.700583391844624, -999.0 ], [ 12.536372822732455, 55.697864443219281, -999.0 ], [ 12.526200122493627, 55.696983645247528, -999.0 ], [ 12.527793477603566, 55.695617229006025, -999.0 ], [ 12.52099778827445, 55.693472711687498, -999.0 ], [ 12.517520839568377, 55.690854953735794, -999.0 ], [ 12.515978245965664, 55.691009423423061, -999.0 ], [ 12.507469981824794, 55.697642162728606, -999.0 ] ] ] } },
Hello Thomas,
If you are looking to remove the map content altogether, you can set the BackgroundContent of the XamGeographicMap to null, or {x:Null} in XAML.
If you are just looking to remove the city / state / country details and are looking for more of an aerial view, I would recommend looking into using the different types of Geographic Map Imagery that we provide. For example, the Aerial BingMapsImagery may help you, as shown here: https://es.infragistics.com/help/wpf/geographicmap-displaying-geographic-imagery-from-bing-maps. Please note, though, that to use BingMapsImagery, you will need to obtain an API key from them to plug in to the ApiKey property of the BingMapsMapImagery object.
Regarding the Rect values, in the case of the sample, I got them by zooming into the map and copying the value from the ActualWindowRect of the map, using a third-party visual tree inspection tool called Snoop. You can also zoom the map by using one of the many navigation techniques described here: https://es.infragistics.com/help/wpf/geographicmap-navigating-map-content-using-code.
Please let me know if you have any other questions or concerns on this matter.
How can I remove all the map details like roads etc and where did you get the Rect values ?
Just a couple of questions
In order to use this type of JSON data in an Infragistics map control, I would recommend that you instead utilize the XamGeographicMap rather than the XamMap, as the XamMap would require you to convert your data into a .shp file prior to creating a layer for the data. The XamGeographicMap also will not take this form of data directly, but you can read the JSON data in and create (X, Y) Points for it and then use it with a GeographicShapeSeries.
I am attaching a sample project that takes the sample data that you have provided here and converts it into a List<Point> to plot it with a GeographicShapeSeries. I hope this helps you.
XamMapGeoJSONCase.zip