New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
viewport-mercator-project assertion failed #675
Comments
The problem is likely due to setting the viewport width to a string instead of a number. |
Your propTypes specify |
@jcready Using string for width is allowed in v4.0. Although in the above code sample, the
|
@Pessimistress Thanks for the great suggestion, I did try this, but then the map doesn't render quite properly within the parent div and breaks over from the styling of that div.
Unless I'm missing something, it looks fairly standard and expected... |
am also having a similar problem! EDIT: Never mind! Had the wrong order on |
@gurbraj Did you find that swapping the order of |
@tmhn, Yes it seems to have fixed it on my end. Given that you can render the map at all without any (Of course, if this fixes it, the switch of ordering would come higher up = ) |
It's important latitude doesn't go outside |
Invalid |
In my case this happens when using a string for width/height:
using a number instead of a string removes the error:
But sadly doesn't solve my issue because I need a |
Accidentally swapping latitude and longitude was my problem as well! |
@mightym I had the same issue when trying to fit bounds using I fixed it by replacing the width and height of I don't know if it can help you, but if it does, beware that accessing |
I was running into this because I was passing a null lat/lng pair. FWIW, I'm using version 6.1.1 of viewport-mercator-project, which includes uber-archive/viewport-mercator-project#91, but I was still just seeing the assertion failed error message. |
Were you able to find a solution for this? Would appreciate any help |
Maybe it'll help someone: |
@tmhn i got a similar issue with you and error rooted from the Marker. In your case, seems like your marker is accessing props |
I got similar issue. Just converted the latitude and longitude I've received to a number. |
had the same issue, for me it was because I was providing a padding too big compared to my width.
|
const mapViewportBounds = mapViewport.fitBounds([ |
@math.gl/web-mercator: assertion failed. |
@chiho13 same for me - turns out I was specifying |
I was getting the same error. Turning |
I also had the problem with the relative height/width so I checked them before my fitToBounds function:
... |
thank you sir! |
React-map-gl not supports string number **only support Number latitude longitude ** . please check your json |
Did you remember why you validate Thanks in advance |
I realise that the title relates to another Uber project - viewport-mercator-project, however it looks rather quiet there and I'm using this package within my React app, I thought here might be a better option.
I've tried to render a Map within a Create React App project:
react v: 16.5.2
react-map-gl v: 4.0.2
When navigating to the page with the Map component, it resulted in this error in the Chrome console
The React Map component:
Does anyone have any ideas about how to resolve this? Perhaps fixing the version of react-map-gl to "^3.." ?
The text was updated successfully, but these errors were encountered: