开发者

Android Development - Using a PNG as a map, marker for current location

开发者 https://www.devze.com 2023-04-05 16:06 出处:网络
I have a large PNG (around 1500 x 2000) that cut into slices and put back together using HTML because otherwise the image quality is horrible.

I have a large PNG (around 1500 x 2000) that cut into slices and put back together using HTML because otherwise the image quality is horrible. I want to be able to have a marker of the user's current location on this image. I'm a little lost about how to do this, especially if the image is zoomable. Ex: How do I make the marker have variable location on the string? (codewise) How do I know how much to change the coordinates by when they zoom in? Help or code samples would be highly apprec开发者_如何学Pythoniated! I am very stuck. Thanks!

Note: Please be specific, I admit I am not experienced at android development


Why not just store the marker position on the original image coordinates (x, y)? eg. if the user is in the middle, save their position as (750, 1000). When you zoom, everything is relative; so if you zoom to 2x, the full image would be 3000x4000, and the marker position would be (1500, 2000).

I don't see what your difficulty is :) maybe I'm underestimating what the problem is.

0

精彩评论

暂无评论...
验证码 换一张
取 消