Giter Club home page Giter Club logo

Comments (14)

CodyMcMichael avatar CodyMcMichael commented on May 28, 2024 7

I'm also seeing this issue, although the map works and goes to the location. The [lat, long] values are never updating. I'm also seeing it working with searching for a POI or feature, and failing for cities and states.

    "react-map-gl": "4.1.1",
    "react-map-gl-geocoder": "1.7.0",

Interestingly enough, I had set a height and width on the MapGL component and it looks like removing this and adding it in the viewport state object fixed my issue.

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024 3

I believe I've fixed the issue with the latest version (v2.0.5). Let me know if you still have any problems after pulling the update.

from react-map-gl-geocoder.

yn5 avatar yn5 commented on May 28, 2024 2

@SamSamskies I can confirm the issue is fixed in our app with the latest version 🎉

Thanks for your effort @SamSamskies and all other contributers to the issue!

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024

Hi @NetisGod, I'm not able to reproduce this error. Could you provide a specific search query that causes this error for you? Also, please provide version numbers that you are using for this module as well as react-map-gl.

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024

Could you also try logging your viewport values in your render function? Let me know what the values are right before the error happens.

from react-map-gl-geocoder.

NetisGod avatar NetisGod commented on May 28, 2024

I type 'Kenya', for example and then I receive this error. If I type 'Kyiv' it works well.
"react-map-gl-geocoder": "^1.7.0"
"react-map-gl": "^4.1.1"

from react-map-gl-geocoder.

NetisGod avatar NetisGod commented on May 28, 2024

I put console.log(this.props.viewport) in Map.jsx and received next: (Tried to find out what Geocoder writes in viewport right before crush but could not accomplish this, Geocoder crushes earlier)
https://user-images.githubusercontent.com/22257069/55030748-a7b98780-5015-11e9-9aa0-d1d2aa82c5ed.png

Sam, please, run the code at local server to find out more, here it is https://github.com/NetisGod/Viewpoints-issue

from react-map-gl-geocoder.

NetisGod avatar NetisGod commented on May 28, 2024

It worked for me also ! Thank you ! But I can't understand how it can be an issue

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024

Seems like you've resolved the problem. Closing this issue. Let me know if you have any other problems.

from react-map-gl-geocoder.

CodyMcMichael avatar CodyMcMichael commented on May 28, 2024

Looks like this PR could be addressing part of the issue that was referenced here. uber-archive/viewport-mercator-project#67

Removing the height and width as I stated earlier did allow me to search using the geocoder control, however it breaks my map, or forces me to set it a fixed width/height. I need to it be 100% width and height of the container.

Back to the original issue, it seems like the lat/long are never being actually passed in, possibly because of the issue I addressed above.

I can confirm this doesn't happen on addresses, but on places and countries.

Do you have any thoughts on this?

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024

@CodyMcMichael I haven't been able to recreate any of the issues that you're having, so it's hard to say if that PR has anything to do with your problems.

Feel free to open a new issue for each problem that you're having. Please provide a simple Code Sandbox that demonstrates your issue along with what queries cause problems for you for each issue that you open. You can fork this basic example as a starting point: https://codesandbox.io/s/x9362myl4q.

from react-map-gl-geocoder.

yn5 avatar yn5 commented on May 28, 2024

@CodyMcMichael you can set 100% height and with in your state object too, using strings.

@SamSamskies I ran into the same problem and fixed it for now by putting height and width in the state object as @CodyMcMichael suggests. Tried to reproduce the issue by amending your Codesandbox starting point without any luck, tried setting all the dependency versions to the ones I have in my project and align the code but didn't succeed in reproducing the issue in Codesandbox.

I have done a pull request #38 that adds a little note about this to README to save time for future users.

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024

@yn5 Thanks for reporting the issue. I'll look into it more this weekend. I can probably force this error by setting the width and height of the viewport to 0 and then figure out what to do from there. I'll probably just use the default zoom instead of trying to fit zoom to the viewport in that case.

from react-map-gl-geocoder.

SamSamskies avatar SamSamskies commented on May 28, 2024

Just pushed a new version that catches errors thrown by WebMercatorViewport when trying to zoom to bbox. Added some logging to help with debugging.

from react-map-gl-geocoder.

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.