THIS SDK ISDEPRECATED. We rolled out a new and better SDK for you.
Allow your users to perform a free text search inside geometries specified by circles and/or
polygons.
Sample use case: You are planing to visit the area of Amsterdam. You need find a parking spot,
an ATM, and a grocery store in the city centre in Amsterdam and/or in the west part of the city.
Use the following code to try this in your app:
Copy 1 List < Geometry > geometries = new ArrayList < > ( )
2 geometries . add ( new Geometry ( new PolygonGeometry ( DefaultGeometries . POLYGON_POINTS ) ) ) ;
3 geometries . add ( new Geometry ( new CircleGeometry ( DefaultGeometries . CIRCLE_CENTER , DefaultGeometries . CIRCLE_RADIUS ) ) ) ;
Copy 1 val circleGeometry = createDefaultCircleGeometry ( )
2 val polygonGeometry = createDefaultPolygonGeometry ( )
3 val geometriesList = listOf ( Geometry ( circleGeometry ) , Geometry ( polygonGeometry ) )
5 val query = GeometrySearchQueryBuilder . create ( term , geometriesList )
6 . withLimit ( SEARCH_RESULTS_LIMIT )
Copy 1 GeometrySearchQuery query = new GeometrySearchQueryBuilder ( term , geometries )
2 . withLimit ( SEARCH_RESULTS_LIMIT ) . build ( ) ;
4 SearchApi searchAPI = OnlineSearchApi . create ( context , BuildConfig . SEARCH_API_KEY ) ;
5 searchAPI . geometrySearch ( query , geometrySearchCallback ) ;
Copy searchApi . geometrySearch ( geometryQuery )
Sample views utilizing Geometry Search:
Geometry search with term: Parking
Geometry search with term: ATM