Hi,
I would like to add openlayerOverlay in a wpfmap control
When I run the application, I get an empty map
I tried to set a CacheDirectory, but the map is still empty even if some folders are created by MapSuite in the directory.
Do I miss something with OpenStreetMap?
The code is :
map.MapUnit = GeographyUnit.Meter;
map.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.SimpleColors.PaleOrange);
OpenStreetMapOverlay osmOvelerlay = new OpenStreetMapOverlay();
osmOvelerlay.CacheDirectory = @"C:\Steph_DevEnCours\Carto_WMS\Carto_WMS\bin\Debug\tmp";
map.Overlays.Add("OpenStreetMap", osmOvelerlay);
MessageBox.Show(map.CurrentExtent.ToString());
var rc = new RectangleShape(-620000, 6720000, 870000, 5120000);
map.CurrentExtent = rc;
MessageBox.Show(map.CurrentExtent.ToString());
map.Refresh();
The weird thing is even if I set this bbox ((-620000, 6720000, 870000, 5120000)), the currentextend displayed is not this one but this one "-2371855.14605627,7450204.32932289,2621855.14605627,4389795.67067711"
Thanks for our help.
Regards.
Steph.
OpenStreetMapLayer problem
Hi Steph,
Could you please tell me what the version you reference? I test the code with version 9.0.0.174 and the OpenStreetMapOverlay doesn’t contain the CacheDirectory property and it had been replaced by the TileCache property.
You can get the newest version from the Product Center 9.0.
The bbox is not equal with the value rc you assigned, the reason is that the CurrentExtent property of WpfMap will be snapped to the nearest zoom level(from 1 to 20 by default) when set it.
Hope it’s helped.
Thanks,
Peter
Hi Peter,
I found why i had an empty map.
I suscribe the openOverlay to the event SendingWebRequest and I précise the proxy and that works.
Thanks.
Regards.
Hi Steph,
Very glad to hear it’s working for you.
Thanks,
Peter