Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed map search #3491

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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 @@ -32,6 +32,7 @@ import com.mapbox.geojson.FeatureCollection
import com.mapbox.geojson.MultiPoint
import com.mapbox.geojson.Point
import com.mapbox.mapboxsdk.Mapbox
import com.mapbox.mapboxsdk.camera.CameraPosition
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException
import com.mapbox.mapboxsdk.geometry.LatLngBounds
Expand Down Expand Up @@ -318,7 +319,11 @@ class GeoWidgetFragment : Fragment() {
}

private fun zoomToLocationsOnMap(features: List<Feature>) {
if (features.isEmpty()) return
if (features.isEmpty()) {
geoJsonSource?.setGeoJson(null as FeatureCollection?)
mapView.getMapAsync { mapboxMap -> mapboxMap.easeCamera(CameraUpdateFactory.newCameraPosition(CameraPosition.DEFAULT)) }
return
}
featureCollection = FeatureCollection.fromFeatures(features)

val locationPoints =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation was refactored.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would no longer be required.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3488

Expand Down
3 changes: 3 additions & 0 deletions android/quest/src/gizEir/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="no_found_locations_matching_text">No caregiver found matching text \"%1$s\"</string>
</resources>
Comment on lines +1 to +3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close this PR and create a new PR pointing to the main branch with this change in gizEir build variant. @f-odhiambo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ellykits I might be wrong but this is on the gizEir strings.xml. I think it's fine there

Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,12 @@ class GeoWidgetLauncherFragment : Fragment(), OnSyncListener {
geoWidgetConfig = geoWidgetConfiguration,
searchText = searchText,
)
if (geoJsonFeatures.isNotEmpty()) {
geoWidgetViewModel.features.postValue(geoJsonFeatures)
} else {
geoWidgetViewModel.features.postValue(geoJsonFeatures)
if (geoJsonFeatures.isEmpty()) {
geoWidgetLauncherViewModel.emitSnackBarState(
SnackBarMessageConfig(
message =
getString(R.string.no_found_locations_matching_text, searchText),
getString(R.string.no_found_locations_matching_text, searchText),
),
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition has just been inverted. Not necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owais-vd @syedowaisali please look into this.

Expand Down
Loading