Giter Site home page Giter Site logo

Comments (4)

Heiko-Zelt avatar Heiko-Zelt commented on July 18, 2024

I have got the fitPoints from EXIF data of photos I took. It's possible that sometimes different photo images accidentally have the same latitude. I want zoomToBestFit() to always work. Either I have to write a workaround for myself or I could deliver a bug fix. I like the concept of test driven development. So I would write a test first. Usually I use JUnit 5. I don't see any JUnit tests in this GitHub repository. So I would add dependencies to build.gradle.

dependencies {
    implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1'
    testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1'
}

from jxmapviewer2.

msteiger avatar msteiger commented on July 18, 2024

Yes, sounds good to me. I will review the pull request.

from jxmapviewer2.

Heiko-Zelt avatar Heiko-Zelt commented on July 18, 2024

I wrote 3 unit tests. I used JUnit 4 for compatibility with Java 7.

JXMapViewerTest.java

I think the problem is that "GeoBounds" must have an extend in JxMapViewer. minLat can't be equal to maxLat and minLng can't be equal to maxLng.

        if (!(minLat < maxLat))
        {
            throw new IllegalArgumentException("GeoBounds is not valid - minLat must be less that maxLat.");
        }

I compared the behavior with Leaflet. In Leaflet "LatLngBounds" can have zero extend in both directions. So it's just a point. For example the Leaflet-method "flyToBounds" can handle this. That would be the perfect solution for me. I don't know changing it in JxMapViewer could break compatibility with older projects. Introducing another Class "GeoBounds0" and another method "fitToBounds0" would bloat the code.

from jxmapviewer2.

msteiger avatar msteiger commented on July 18, 2024

So this issue should be fixed now, right?

from jxmapviewer2.

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.