Coder Social home page Coder Social logo

Comments (4)

pauldendulk avatar pauldendulk commented on September 21, 2024 1

Thanks for reporting this. It looks like a bug.

from mapsui.

pauldendulk avatar pauldendulk commented on September 21, 2024

Had a look at this. We could make the layer Name a mandatory parameter of the OnDataChangedEventArgs constructor. This solves a lot of problems but a complication is that it is also used in some providers. So, perhaps in those cases the providers should return another type of event args (OnProviderDataChangedEventArgs?) and the layers should create their own OnDataChangedEventArgs when they handle those events.

from mapsui.

damusthe avatar damusthe commented on September 21, 2024

The workaround I used is the following :

/// <summary>
/// Map DataChanged event to generate IsBusy ViewModel for showing activity indicator
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Map_DataChanged(object sender, Mapsui.Fetcher.DataChangedEventArgs e)
{
	if ((sender != null) && (sender is ILayer) && ((ILayer)sender).Name == "OpenStreetMap")
	{
		IsBusy = ((ILayer)sender).Busy;
	}
}

I'm using the sender ILayer.Name instead of the event args.

I don't know enough Mapsui architecture, but changing DataChangedEventArgs type on context would be a problem at use.

from mapsui.

pauldendulk avatar pauldendulk commented on September 21, 2024

I fixed this in main by making the layerName constructor argument mandatory for the DataChangeEventArgs and remove use of it in non-layers. These now use an event with minimal data.
#2685

I improved this in develop/4.1 without introducing breaking changes
#2684

from mapsui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.