Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Refactoring #setGeoJson() to pass in Point object directly as a parameter #1040

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public boolean onMapClick(@NonNull LatLng point) {
if (style != null) {
GeoJsonSource source = style.getSourceAs("click-source-id");
if (source != null) {
source.setGeoJson(Feature.fromGeometry(Point.fromLngLat(point.getLongitude(), point.getLatitude())));
source.setGeoJson(Point.fromLngLat(point.getLongitude(), point.getLatitude()));
}

// Request and redraw the Isochrone information based on the map click point
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public boolean onMapLongClick(@NonNull LatLng point) {
private void resetDestinationMarkers(@NonNull Style style) {
GeoJsonSource optimizedLineSource = style.getSourceAs(ICON_GEOJSON_SOURCE_ID);
if (optimizedLineSource != null) {
optimizedLineSource.setGeoJson(Feature.fromGeometry(Point.fromLngLat(origin.longitude(),
origin.latitude())));
optimizedLineSource.setGeoJson(Point.fromLngLat(origin.longitude(), origin.latitude()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ public boolean onMapClick(@NonNull LatLng point) {
// Move and display the click center layer's red marker icon to wherever the map was clicked on
GeoJsonSource clickLocationSource = style.getSourceAs(CLICK_CENTER_GEOJSON_SOURCE_ID);
if (clickLocationSource != null) {
clickLocationSource.setGeoJson(Feature.fromGeometry(Point.fromLngLat(point.getLongitude(),
point.getLatitude())));
clickLocationSource.setGeoJson(Point.fromLngLat(point.getLongitude(), point.getLatitude()));
}

// Use the map click location to make a Tilequery API call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.mapbox.api.geocoding.v5.models.CarmenFeature;
import com.mapbox.api.geocoding.v5.models.GeocodingResponse;
import com.mapbox.core.exceptions.ServicesException;
import com.mapbox.geojson.Feature;
import com.mapbox.geojson.Point;
import com.mapbox.mapboxandroiddemo.R;
import com.mapbox.mapboxsdk.Mapbox;
Expand Down Expand Up @@ -129,8 +128,7 @@ public void onClick(View view) {
if (style.getLayer(DROPPED_MARKER_LAYER_ID) != null) {
GeoJsonSource source = style.getSourceAs("dropped-marker-source-id");
if (source != null) {
source.setGeoJson(Feature.fromGeometry(Point.fromLngLat(
mapTargetLatLng.getLongitude(), mapTargetLatLng.getLatitude())));
source.setGeoJson(Point.fromLngLat(mapTargetLatLng.getLongitude(), mapTargetLatLng.getLatitude()));
}
style.getLayer(DROPPED_MARKER_LAYER_ID).setProperties(visibility(VISIBLE));
}
Expand Down