feat: add ContainCameraLatitude#2073
Conversation
There was a problem hiding this comment.
Thanks @mbenoukaiss! Sorry I haven't got to this earlier.
We do need to find some way to describe a & b. I can live with the names (although they're not ideal), but we do need to put a docstring on each of them. I know you said you'd prefer not to imply order, but I'm not sure why? Would positive & negative or north and south work?
I'm assuming you set a & b to the latitudes, such as 180 and -180? Maybe it's a good idea to add this to one of the examples, but I can find a space for that.
I think ContainCameraLatitude might be a better name, as it doesn't matter about rotation.
On that note, I need to test this to make sure it works correctly when the map is rotated as well. Would it be possible to add some unit tests for this as well?
Also not 100% familiar with dart but I could not find a way to keep the constructor constant with a condition on crs.replicatesWorldLongitude.
That's a good point. I'll think about it, but I think this is probably OK for now.
Added defaults of 90 & -90 Added documentation Added to example page
ContainCameraVerticallyContainCameraLatitude
JaffaKetchup
left a comment
There was a problem hiding this comment.
LGTM, thanks :). Seems to work with rotation.
|
Hey, sorry I haven't had much time to make the changes. You're right about north/south, it makes more sense but I did not think of it, I was thinking about top/bottom which did not make sense because of map rotation. ContainCameraLatitude is indeed a better choice! |
Allows constraining the camera vertically and not horizontally #2071
ContainCameraVerticallyorContainCameraLatitudinally?aandbparameters naming, but I don't like anything that would mention a notion of order (likeminandmax) because it does not quite make sense, let my know if this is alright or if you have a suggestionCameraConstraint.unconstrained(), it would potentially be a breaking change. Also not 100% familiar with dart but I could not find a way to keep the constructor constant with a condition oncrs.replicatesWorldLongitude.