neXenio / BLE-Indoor-Positioning

Multilateration using bluetooth beacons
Apache License 2.0
430 stars 129 forks source link

How to get pixel co-ordinate with respect to image in map fragment? #174

Closed jasirjasir closed 4 years ago

jasirjasir commented 4 years ago

After setting Geo coordinates to each beacon , i am able to get my current location in the map after trilateration. Is there any way to convert these received Geo coordinates to pixel coordinate w.r.t floor `plan ( X and Y coordinate w.r.t floor plan).

IndoorPositioning.registerLocationListener(new LocationListener() { @Override public void onLocationUpdated(LocationProvider locationProvider, Location location) { //Need to convert location (latitude and longitude) data to image co-ordinate x and y } });

Steppschuh commented 4 years ago

Sure, that's what the CanvasProjection is for. You can see it being used in the BeaconMap, e.g. when drawing the beacons. The demo app converts spherical coordinates and cartesian coordinates using the Mercator projection.

jasirjasir commented 4 years ago

Thanks @Steppschuh