Search code examples
androidmapscoordinate-systemsindoor-positioning-system

Translating floor plan position into coordinates on screen map


I have a custom floor plan in an ImageView and I am trying to determine how to translate a position on the floor plan into screen coordinates.

Is there a recommended way to go about implementing this as I'm not sure how to proceed. I am not using the Maps API, just a custom floor plan I created myself.


Solution

  • Try this:

    screenCoordX = (imageCoordX / imageWidth) * screenWidth;
    screenCoordY = (imageCoordY / imageHeight) * screenHeight;
    

    Make sure all the values are floats / doubles.

    This should get you started.