INNER CODE UNIT · Java

propertiesMapForPlace

tolu360/react-native-google-places · android/src/main/java/com/arttitude360/reactnative/rngoogleplaces/RNGooglePlacesModule.java:361

    private WritableMap propertiesMapForPlace(Place place, List<Place.Field> selectedFields) {
        // Display attributions if required.
        // CharSequence attributions = place.getAttributions();

        WritableMap map = Arguments.createMap();

        if (selectedFields.contains(Place.Field.LAT_LNG)) {
            WritableMap locationMap = Arguments.createMap();
            locationMap.putDouble("latitude", place.getLatLng().latitude);
            locationMap.putDouble("longitude", place.getLatLng().longitude);

            map.putMap("location", locationMap);
        }

        if (selectedFields.contains(Place.Field.NAME)) {
            map.putString("name", place.getName());
        }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…