Coder Social home page Coder Social logo

Comments (6)

pauldendulk avatar pauldendulk commented on July 20, 2024 1

You could use Navigator.ZoomToBox(viewport.ToExtent()) instead

from mapsui.

pauldendulk avatar pauldendulk commented on July 20, 2024

There may be something broken with the Busy state. What if you just wait for two seconds?

from mapsui.

johnjore avatar johnjore commented on July 20, 2024

Tried adding 10 second delay but no change.

However I had a brain wave and added a random Height = 1000:

//Create viewport to match GPX list
var viewport = new Viewport()
{
    Width = MainActivity.mContext.Resources.DisplayMetrics.WidthPixels,
    Height = 1000
};

A full width image is now created. This was not needed on 3.x? Or I was just lucky on 3.x?

from mapsui.

pauldendulk avatar pauldendulk commented on July 20, 2024

Yes, the Width and Height need to be set. Something probably changed in the defaults. The Viewport was entirely rewritten in v4.

I tried to not set the Height in a unit test and I get an exception, so that may also have happened within your code. Make sure to attach to the Mapsui logger https://mapsui.com/documentation/logging.html.

Perhaps the Navigator.SetViewport method should be made private because it also sets the Width and Height which should not be controlled by the user but only by the MapControl.

from mapsui.

johnjore avatar johnjore commented on July 20, 2024

Thanks for the info! This one can probably be closed as its "just" changed behaviour between 3.x and 4.x and it somehow is working. Will probably break in 5.x when you make the method private, but that's a future bridge to cross.

I'll add logging to my project, thanks for the link, I had missed that one.

from mapsui.

johnjore avatar johnjore commented on July 20, 2024

Hm... Its not a drop-inn replacement. As long as I use this, it works:
Fragment_map.mapControl?.Map.Navigator.SetViewport(viewport);

I either get a square that does not have any of my gpx route, or just the narrow strip, missing left and right of the route when using viewport.ToExtend(). Will need more investigating to see what is going on here.

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.