Skip to content
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

Support for .png deep zoom map #39

Closed
AdminCarlos opened this issue Sep 11, 2022 · 0 comments
Closed

Support for .png deep zoom map #39

AdminCarlos opened this issue Sep 11, 2022 · 0 comments

Comments

@AdminCarlos
Copy link

Currently, i can't seem to use a deep zoom map generated in .png format. I get the following errors:

W/BitmapFactory: bitmap marked for reuse (131072 bytes) can't fit new bitmap (262144 bytes)

Is there no support for .png maps or am i doing something wrong?

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val mapView = this.findViewById<MapView>(R.id.mapview) ?: return

        val tileStreamProvider = TileStreamProvider {row, col, zoomLvl ->
            try {

                this.assets?.open("tiles/esp/$zoomLvl/$row/$col.png")

            }

            catch (e: Exception) {

                null

            }

        }

        val config = MapViewConfiguration(levelCount = 6, fullWidth = 8192, fullHeight = 8192, tileSize = 256, tileStreamProvider)/*.setMinimumScaleMode(MinimumScaleMode.FILL)*/

        mapView.configure(config)

    }
}

Thanks you.

@p-lr p-lr closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants