-
-
Notifications
You must be signed in to change notification settings - Fork 848
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
feat: Add bounds to raster source #3672
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ abstract class RNMBXTileSource<T : Source?>(context: Context?) : RNMBXSource<T>( | |
var attribution: String? = null | ||
var minZoomLevel: Int? = null | ||
var maxZoomLevel: Int? = null | ||
var bounds: Array<Double>? = null | ||
var tMS = false | ||
fun buildTileset(): TileSet { | ||
val tileUrlTemplates = | ||
|
@@ -35,10 +36,14 @@ abstract class RNMBXTileSource<T : Source?>(context: Context?) : RNMBXSource<T>( | |
if (attribution != null) { | ||
builder.attribution(attribution) | ||
} | ||
if(bounds != null) { | ||
val boundsArray = bounds!!.clone() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, you will get an error:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be able to do something like this: bounds?.let {
builder.bounds(Arrays.asList(it))
} |
||
builder.bounds(Arrays.asList(*boundsArray)) | ||
} | ||
return builder.build() | ||
} | ||
|
||
companion object { | ||
const val TILE_SPEC_VERSION = "2.1.0" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check necessary here? We'll just silently error if the size is not 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this, you will get an error like this:
Personally, I prefer a more direct message, but I leave it up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, mybad, you're right I've missed the Logger.e at the end.
Nitpick: Can please you rewrite the logic so we have early return on error statements, and not, the success case
Something like: