Skip to content

Commit 6112f37

Browse files
committed
fix(android): project result in dpi
1 parent 96cf348 commit 6112f37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mapbox.android.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AndroidApplication, Application, Color, File, Image, ImageSource, Trace
99
import { getImage } from '@nativescript/core/http';
1010
import { FilterParser } from './filter/filter-parser.android';
1111
import { GeoUtils } from './geo.utils';
12+
import { layout } from '@nativescript/core/utils';
1213
import { LayerFactory } from './layers/layer-factory';
1314
import {
1415
AddExtrusionOptions,
@@ -3266,7 +3267,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
32663267
project(data: LatLng) {
32673268
const mapboxPoint = new com.mapbox.mapboxsdk.geometry.LatLng(data.lat, data.lng);
32683269
const screenLocation = this._mapboxMapInstance.getProjection().toScreenLocation(mapboxPoint);
3269-
return { x: screenLocation.x, y: screenLocation.y };
3270+
return { x: layout.toDeviceIndependentPixels(screenLocation.x), y: layout.toDeviceIndependentPixels(screenLocation.y )};
32703271
}
32713272
}
32723273

0 commit comments

Comments
 (0)