Skip to content

Commit a70a592

Browse files
committed
fix: update for latest sdk
1 parent 101e587 commit a70a592

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

src/ui/index.android.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,20 @@ export class CartoMap<T = DefaultLatLonKeys> extends CartoViewBase {
150150
onMapClicked: (mapClickInfo: com.carto.ui.MapClickInfo) => {
151151
if (this.hasListeners(MapClickedEvent)) {
152152
this.sendEvent(MapClickedEvent, {
153-
clickType: mapClickInfo.getClickType().swigValue(),
154-
position: fromNativeMapPos(mapClickInfo.getClickPos()),
153+
android: mapClickInfo,
154+
get clickInfo(){
155+
return {
156+
get duration() {
157+
return mapClickInfo.getClickInfo().getDuration()
158+
}
159+
}
160+
},
161+
get clickType () {
162+
return mapClickInfo.getClickType().swigValue()
163+
},
164+
get position () {
165+
return fromNativeMapPos(mapClickInfo.getClickPos())
166+
}
155167
});
156168
}
157169
},

src/ui/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ export class MapOptions {
179179
* @param zoomRange native Carto MapRange
180180
*/
181181
setZoomRange(zoomRange: any);
182+
183+
setDoubleClickDetection(param0: boolean): void;
184+
isDoubleClickDetection(): boolean;
185+
getLongClickDuration(): number;
186+
setLongClickDuration(param0: number): void;
187+
182188
}
183189

184190
interface CartoMapStyle extends Style {

src/ui/index.ios.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,20 @@ class NTMapEventListenerImpl extends NTMapEventListener {
9090
eventName: MapClickedEvent,
9191
object: owner,
9292
data: {
93-
clickType: mapClickInfo.getClickType(),
94-
position: owner.fromNativeMapPos(mapClickInfo.getClickPos()),
93+
get clickInfo() {
94+
return {
95+
get duration() {
96+
return (mapClickInfo as any).getClickInfo().getDuration();
97+
},
98+
};
99+
},
100+
get clickType() {
101+
return mapClickInfo.getClickType();
102+
},
103+
get position() {
104+
return fromNativeMapPos(mapClickInfo.getClickPos());
105+
},
106+
ios: mapClickInfo,
95107
},
96108
});
97109
}

0 commit comments

Comments
 (0)