none
Visibility of MapTileSource RRS feed

  • Question

  • MapTileSource tileSource =  new MapTileSource();

    ...

    tileSource.Visible = false does not work if tile was painted on Windows 10.0.17763.

    Is it correct behavior?



    Friday, December 7, 2018 12:10 PM

All replies

  • Hi Alek,

    It sounds like your tile source (https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.Maps.MapTileSource) mmay be failing,  Does your code work on other Windows Builds?  Also, if you are using insider builds, you should report the issues through the insider program.

    Sincerely,

    IoTGirl

    Friday, December 7, 2018 5:28 PM
    Owner
  • This looks like a bug in the latest release. The best workaround is to remove the tile layer rather than toggling visibility. There shouldn't be much difference in terms of performance.
    Friday, December 7, 2018 10:28 PM
    Moderator
  • Thank you for your reply.

    Layer deletion gets to app crash in case, when user attends page more than once on this Windows build. There was no such thing on the previous build. But I had memory leaks when I worked with win2d. Now I have not leaks, but I have troubles with MapControl. :)

    In addition, I can't inherit of HttpTileDataSource class. It throws an exception when I try to construct a new object. But it isn't problem.

     



    Monday, December 10, 2018 11:47 AM
  • Removing the tile source appears to be working normally - are you sure you're not getting a crash somewhere in the calling code? A call stack or sample code showing what you're doing would help.

    Deriving a class from HttpTileDataSource is not a supported scenario. If you have custom request behavior you want to implement, you can use CustomTileDataSource to execute your own request logic or tile building behavior.

    Monday, December 10, 2018 5:22 PM
    Moderator
  • Thank you, I fixed the problem.

    In my case, I use CustomMapTileDataSource. When user leaves a page with MapControl I catch BitmapRequested event for some reason and any asynchronous method call freezes app. I handled this situation without tile source removing because I had random access violation exceptions with this stack:

    ntdll.dll!RtlpWaitOnCriticalSection()
    ntdll.dll!RtlpEnterCriticalSectionContended()
    ntdll.dll!RtlEnterCriticalSection()
    BingMaps.dll!Pal::CppEvent<class MapControl::MapMode &>::detach(class Pal::EventId *)
    BingMaps.dll!JpMapControlBingAdapter::~JpMapControlBingAdapter(void)
    BingMaps.dll!JpMapControlBingAdapter::`vector deleting destructor'(unsigned int)
    BingMaps.dll!Microsoft::WRL::Details::RuntimeClassImpl<struct Microsoft::WRL::RuntimeClassFlags<1>,1,1,0,struct IMapControlAdapter,struct IMapControlAdapterInternal,struct IOverviewMapControlAdapter,struct IMapOverlayModelBingServices>::Release(void)
    JpMapControl.dll!JpMapControlHybridAdapter::~JpMapControlHybridAdapter(void)
    JpMapControl.dll!JpMapControlHybridAdapter::`vector deleting destructor'(unsigned int)
    JpMapControl.dll!Microsoft::WRL::Details::RuntimeClassImpl<struct Microsoft::WRL::RuntimeClassFlags<1>,1,1,0,struct IMapControlAdapter,struct IMapControlHybridAdapter,struct IMapControlHybridAdapterPrivate,struct IMapKeyValidator,class Microsoft::WRL::FtmBase>::Release(void)
    Windows.UI.Xaml.dll!DirectUI::TrackerTargetReference::Clear(unsigned char bEnsureTrackerTarget, unsigned char bForceLoopback) Line 697
    at onecoreuap\windows\dxaml\xcp\components\lifetime\lib\trackertargetreference.cpp(697)
    [Inline Frame] Windows.UI.Xaml.dll!DirectUI::TrackerPtr<IUnknown,1,0>::Clear() Line 267
    at onecoreuap\windows\dxaml\xcp\components\lifetime\inc\trackerptr.h(267)
    [Inline Frame] Windows.UI.Xaml.dll!ctl::WeakReferenceSourceNoThreadId::RemovePtrValue(DirectUI::TrackerPtr<IUnknown,1,0> &) Line 233
    at onecoreuap\windows\dxaml\xcp\components\lifetime\inc\weakreferencesourcenothreadid.h(233)
    [Inline Frame] Windows.UI.Xaml.dll!ctl::WeakReferenceSourceNoThreadId::DeleteTrackerHandle(TrackerHandle__ *) Line 1087
    at onecoreuap\windows\dxaml\xcp\components\lifetime\lib\weakreferencesourcenothreadid.cpp(1087)
    Windows.UI.Xaml.dll!ctl::interface_forwarder<ITrackerOwner,DirectUI::DependencyObject>::DeleteTrackerHandle(TrackerHandle__ * handle) Line 98
    at onecoreuap\windows\dxaml\xcp\components\lifetime\inc\weakreferencesourcenothreadid.h(98)
    Windows.UI.Xaml.Maps.dll!Private::TrackerPtr<struct Windows::Foundation::Collections::IObservableVector<class Windows::UI::Xaml::DependencyObject *> >::~TrackerPtr<struct Windows::Foundation::Collections::IObservableVector<class Windows::UI::Xaml::DependencyObject *> >(void)
    Windows.UI.Xaml.Maps.dll!Windows::UI::Xaml::Controls::Maps::MapControl::~MapControl(void)
    Windows.UI.Xaml.Maps.dll!Windows::UI::Xaml::Controls::Maps::MapControl::`vector deleting destructor'(unsigned int)
    Windows.UI.Xaml.Maps.dll!Private::ReferenceTrackerRuntimeClass<struct Windows::UI::Xaml::Controls::Maps::IMapControl,struct Windows::UI::Xaml::Controls::Maps::IMapControl2,struct Windows::UI::Xaml::Controls::Maps::IMapControl3,struct Windows::UI::Xaml::Controls::Maps::IMapControl4,struct Windows::UI::Xaml::Controls::Maps::IMapControl5,struct Windows::UI::Xaml::Controls::Maps::IMapControl6,struct Windows::UI::Xaml::Controls::Maps::IMapControl7,class Microsoft::WRL::ComposableBase<struct Windows::UI::Xaml::Controls::IControlFactory>,class Microsoft::WRL::Details::Nil>::DeleteThis(void)
    Windows.UI.Xaml.Maps.dll!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::UI::Core::IDispatchedHandler::*)(void) __ptr64>::DelegateInvokeHelper<Microsoft::WRL::Implements<Microsoft::WRL::RuntimeClassFlags<2>,Windows::UI::Core::IDispatchedHandler,Microsoft::WRL::FtmBase>,<lambda_a50dc9d4724c13a3bfc609e65779fc91>,-1>::Invoke()
    Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessInvokeItem(bool * pbInvokeItemProcessed) Line 1266
    at onecoreuap\windows\advcore\winrt\onecoreiwindow\corewindow\common\dispatcher.cpp(1266)
    Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessMessage(bool bDrainQueue, bool * pbWindowMessagesProcessed, bool * pbInvokeItemProcessed) Line 270
    at onecoreuap\windows\advcore\winrt\onecoreiwindow\corewindow\common\dispatcher.cpp(270)
    Windows.UI.dll!Windows::UI::Core::CDispatcher::WaitAndProcessMessagesInternal(bool bRunAlwaysOnce, void * hEventWait) Line 1953
    at onecoreuap\windows\advcore\winrt\onecoreiwindow\corewindow\common\dispatcher.cpp(1953)
    Windows.UI.dll!Windows::UI::Core::CDispatcher::ProcessEvents(Windows::UI::Core::CoreProcessEventsOption options) Line 599
    at onecoreuap\windows\advcore\winrt\onecoreiwindow\corewindow\common\dispatcher.cpp(599)
    Windows.UI.Xaml.dll!CJupiterWindow::RunCoreWindowMessageLoop() Line 1246
    at onecoreuap\windows\dxaml\xcp\dxaml\lib\jupiterwindow.cpp(1246)
    [Inline Frame] Windows.UI.Xaml.dll!CJupiterControl::RunMessageLoop() Line 1024
    at onecoreuap\windows\dxaml\xcp\dxaml\lib\jupitercontrol.cpp(1024)
    Windows.UI.Xaml.dll!DirectUI::DXamlCore::RunMessageLoop() Line 2452
    at onecoreuap\windows\dxaml\xcp\dxaml\lib\dxamlcore.cpp(2452)
    twinapi.appcore.dll!00007ffaa8b44a9a()
    twinapi.appcore.dll!00007ffaa8b178d6()
    SHCore.dll!00007ffaaf19c315()
    kernel32.dll!00007ffaaeb27e94()
    ntdll.dll!RtlUserThreadStart()

    Now I postponed the problem with visibility and I hope that it will be fixed in next Windows builds.

    I think HttpMapTileDataSource class should be sealed.

    Saturday, December 15, 2018 1:06 PM