use of com.facebook.react.bridge.WritableArray in project maps by rnmapbox.
the class GeoJSONUtils method fromLatLng.
public static WritableArray fromLatLng(LatLng latLng) {
double[] coords = new double[] { latLng.getLongitude(), latLng.getLatitude() };
WritableArray writableCoords = new WritableNativeArray();
writableCoords.pushDouble(coords[0]);
writableCoords.pushDouble(coords[1]);
return writableCoords;
}
use of com.facebook.react.bridge.WritableArray in project maps by rnmapbox.
the class RCTMGLMapView method getCenter.
public void getCenter(String callbackID) {
LatLng center = mMap.getCameraPosition().target;
WritableArray array = new WritableNativeArray();
array.pushDouble(center.getLongitude());
array.pushDouble(center.getLatitude());
WritableMap payload = new WritableNativeMap();
payload.putArray("center", array);
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
}
use of com.facebook.react.bridge.WritableArray in project maps by rnmapbox.
the class RCTMGLMapView method getCoordinateFromView.
public void getCoordinateFromView(String callbackID, PointF pointInView) {
float density = getDisplayDensity();
pointInView.x *= density;
pointInView.y *= density;
LatLng mapCoordinate = mMap.getProjection().fromScreenLocation(pointInView);
WritableMap payload = new WritableNativeMap();
WritableArray array = new WritableNativeArray();
array.pushDouble(mapCoordinate.getLongitude());
array.pushDouble(mapCoordinate.getLatitude());
payload.putArray("coordinateFromView", array);
AndroidCallbackEvent event = new AndroidCallbackEvent(this, callbackID, payload);
mManager.handleEvent(event);
}
use of com.facebook.react.bridge.WritableArray in project intercom-react-native by intercom.
the class IntercomHelpCenterHelpers method parseHelpCenterSectionsToReadableArray.
public static WritableArray parseHelpCenterSectionsToReadableArray(List<HelpCenterSection> helpCenterSectionList) {
WritableArray sections = Arguments.createArray();
HelpCenterSection[] sectionsArray = new HelpCenterSection[helpCenterSectionList.size()];
sectionsArray = helpCenterSectionList.toArray(sectionsArray);
;
for (HelpCenterSection section : sectionsArray) {
sections.pushMap(parseHelpCenterSectionToReadableMap(section));
}
return sections;
}
use of com.facebook.react.bridge.WritableArray in project intercom-react-native by intercom.
the class IntercomHelpCenterHelpers method parseHelpCenterCollectionsContentToReadableMap.
public static WritableMap parseHelpCenterCollectionsContentToReadableMap(HelpCenterCollectionContent helpCenterCollectionContent) {
WritableMap helpCenterCollection = Arguments.createMap();
helpCenterCollection.putString("id", helpCenterCollectionContent.getCollectionId());
helpCenterCollection.putString("title", helpCenterCollectionContent.getTitle());
helpCenterCollection.putString("summary", helpCenterCollectionContent.getSummary());
WritableArray articles = parseArticlesToReadableArray(helpCenterCollectionContent.getHelpCenterArticles());
helpCenterCollection.putArray("articles", articles);
WritableArray sections = parseHelpCenterSectionsToReadableArray(helpCenterCollectionContent.getHelpCenterSections());
helpCenterCollection.putArray("sections", sections);
return helpCenterCollection;
}
Aggregations