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
Custom size generator #25
Conversation
import com.google.firebase.perf.FirebasePerformance | ||
import org.osmdroid.util.GeoPoint | ||
import timber.log.Timber |
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.
Unused import |
package com.devindi.wallpaper.model.map | ||
|
||
import com.devindi.wallpaper.misc.RectD | ||
import org.osmdroid.tileprovider.cachemanager.CacheManager |
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.
Unused import |
|
||
// Here is some math magic). Those calculations are taken from OSM wiki | ||
// https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames | ||
fun lonToTile(lon: Double, zoom: Int) = (lon + HALF_CIRCLE_DEGREES) / CIRCLE_DEGREES * (1 shl zoom) |
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.
Exceeded max line length (100) (cannot be auto-corrected) |
// https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames | ||
fun lonToTile(lon: Double, zoom: Int) = (lon + HALF_CIRCLE_DEGREES) / CIRCLE_DEGREES * (1 shl zoom) | ||
|
||
fun latToTile(lat: Double, zoom: Int): Double = (1 shl zoom) * (1 - (Math.log(Math.tan(Math.toRadians(lat)) + 1 / (Math.cos(Math.toRadians(lat))))) / Math.PI) / 2 |
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.
Exceeded max line length (100) (cannot be auto-corrected) |
728b2e4
to
1aa0bda
Compare
Implemented generation of image with custom size ( #4 )