map.fitbounds giving wrong results when bearing is changed - mapbox-gl-js

mapbox-gl-js version: 2.7.0 / all other versions
browser: Chrome/Safari
Steps to Trigger Behavior
View the jsfiddle (add your own accessToken):
https://jsfiddle.net/6fk7up9x/16
Expected Behavior
The markers should be visible at all times(when changing bearing), the map should fit the boundary box depending on the two coordinates that i provided and the provided bearing.
Expected behavior
Actual Behavior
When changing bearing above 180 or under 100, the markers are not visible anymore.
Actual behavior

This has been fixed in version 2.8.0. See this GitHub Pull Request

Related

How to specify zoom level in an OpenStreetMap query?

I would like to include in my software automatically generated links to www.openstreetmap.org that shows a specified address. Something like
click here to see the map
This basic functionality is working right now, but the displayed map zoom level is a bit too high. I would like to set a custom zoom level as a get parameter. It is possible ?
I tried https://www.openstreetmap.org/search?zoom=15&query=<MyCustomAddress> and also z and map parameters without success, and I can't find any documentation about this on the Wiki.

React-leaflet does not work using create-react-app and react 16.8.4

I'm trying to get a basic example of react-leaflet 2.2.1 to work with the latest react release, 16.8.4. However, the leaflet map does not display correctly.
I used create-react-app to create a new project, then modified the App.jsx to include a component that is identical to the codepen example given for react-leaflet. The only change is to the containing div where I specified the height & width.
The map tiles do not render within the div and instead end up in somewhat random positions.
The entire app code in https://github.com/sknutsonsf/agdex/tree/master/src
This looks like some kind of compatibility issue with the new react version.
I had the same issue, adding
import 'leaflet/dist/leaflet.css';
solved my problem

Unity not allowing me to use Screen.safeArea

I am trying to adjust the UI in my game to properly fit on the screen of an iPhone X.
In my code I am attempting to code the line return Screen.safeArea
However 'safeArea' is highlighted red and when I hover over the error with my cursor a message is displayed saying "error CS0117: 'UnityEngine.Screen' does not contain a definition for 'safeArea'".
I dont understand why I'm getting this error because according to Unity's documentation UnityEngine.Screen does contain a definition for safeArea.
Any inclination or idea as to why I am running into this error?
Also, I am working with Unity 2017.2.0f3
As per comments bellow, code as been asked for.
private Screen ReturnSafeArea(){return Screen.safeArea}
as I tried saying, the code has nothing to do with it. Even in this simplistic instance of the use of Screen.safeArea, safeArea is listed as not a definition of UnityEngine.Screen.
Hovering over safeArea displays the following message
"'Screen' does not contain a definition for 'safeArea"
Screen.screenArea is of type Rect and your method is defined as returning a value of type Screen
https://docs.unity3d.com/ScriptReference/Screen-safeArea.html
One way to correct this:
private Rect ReturnSafeArea(){
return Screen.safeArea;
}
Additionally, the field was added in 2017.2.0p1 (Nov 6) and you're on 2017.2.0f3 (Oct 3). Link is for 0.2, but 0.f3 does not have its own page, so likely was made either the same day or very shortly after.
I believe Screen.safeArea was added in a minor release of 2017.2, so 2017.2.0f3 would not have it. Try your code in 2017.2.1 and newer to confirm. It's too bad the documentation doesn't specify that.

Was default_marker removed from mapbox-gl.js

I am trying to use the default_marker and/or secondary_marker in mapbox-gl.js however it appears they have been removed from the sprite.json in streets-v9 (probably v8 too). I've found a working example in streets-v7 where they were part of the sprite.json/sprit.png, but they are gone now.
How can I get these back or what is the new replacement? I've gone through the new sprint.png but I don't see anything similar.
Apologies for the change, ongle! We've recently worked to standardize the icons available across all the Mapbox styles which, unfortunately, required some breaking changes.
The closest replacement to default_marker is marker-15. The appearance of this marker will be different per style.
You may also choose to upload your own marker image per this guide.

Leaflet custom map (prod. with MapTiler) not shown in version 0.7.3

My custom map which has been produced by using MapTiler 0-5 levels displays well
on leaflet 0.6.4 but is not shown on version 0.7.3. Sorry, but I'm really new in using leaflet and maps. I've googled and checked the documentation on leaflet.com but haven't got any clue of a solution. Please help.
This is a demo using 0.6.4 and html already prepared for 0.7.3.
Sorry folks, I've just found my solution after googling again with other search
criteria. So I've found thread #2776 from Jakoboud pointing me to a possible solution. This does the trick -> continuousWorld: true and my map shows up.
Here's another question: how can I keep this map centered in browser window if the shown map part is smaller in width/height than browser window? map.setMaxBounds() doesn't work, it's bouncing the small map endlessly.