I want to wrap a javascript code like this :
map.addMarker({
lat: -12.043333,
lng: -77.028333,
draggable: true,
fences: [polygon],
outside: function(m, f){
alert('This marker has been moved outside of its fence');
}
});
Here how I write it in Java :
@JsType(namespace = JsPackage.GLOBAL, isNative = true, name = "Object")
public class MarkerOptions {
@JsProperty
public double lat;
@JsProperty
public double lng;
@JsProperty
public boolean draggable;
@JsProperty
public Polygon fences;
@JsFunction
public interface FunctionOutsideParam {
void outside();
}
@JsProperty
public FunctionOutsideParam outside;
}
But it's not working. Even thou it didn't have any error in my browser console. Anybody know how to make it working for the outside callback function? Thanks and regards.
fencesproperty should bePolygon[], and theFunctionOutsideParamshould take two parameters, right? Can you share the Java you have that does the equivalent of the JS you have in the question?generateJsInteropExportsflag?