How to implement search locations using the POI database(ANDROID)?

294 views
Skip to first unread message

Mariel Basbas

unread,
Mar 7, 2017, 10:21:53 AM3/7/17
to mapsforge-dev
I am completely new to this so I'm not entirely sure on where to go. I already have a search button and i've already tried inputting a few names and its geopoints and it's working. I don't know how to put the names of all the locations(for example: an address to a particular street), and when the user clicks the given item from the listview, it'll change the map position. I've accomplished everything except populating the data on the listview and get its geopoint. 

Emux

unread,
Mar 7, 2017, 12:19:35 PM3/7/17
to mapsfo...@googlegroups.com
So you have gone to the point where you got the results from the POI search.

Then you have a collection of PointOfInterest classes, as seen in PoiSearchViewer.

The PointOfInterest has several getters, among them are coordinates, name, etc.

How you will present the POIs to the user is more an Android development question.
i.e. you can check Android documentation for how to use a ListView

--
Emux

Mariel Basbas

unread,
Mar 8, 2017, 5:12:36 AM3/8/17
to mapsforge-dev

I tried copy and pasting PoiSearchTask on my activity. I can't import PoiSearchViewer. What is its dependency? 

Emux

unread,
Mar 8, 2017, 5:18:48 AM3/8/17
to mapsfo...@googlegroups.com
PoiSearchViewer isn't a library to import.

It's a sample activity to study and use from it the parts you find useful.

--
Emux

Emux

unread,
Mar 8, 2017, 5:23:34 AM3/8/17
to mapsfo...@googlegroups.com
For all Mapsforge dependencies per category (Map or POI) and platform (Android or Desktop), you can look at integration guide.

--
Emux

Mariel Basbas

unread,
Mar 8, 2017, 5:33:24 AM3/8/17
to mapsforge-dev
I've compiled this but PoiSearchViewer still won't import
compile 'org.mapsforge:mapsforge-map-android:0.7.0'
compile 'com.caverock:androidsvg:1.2.2-beta-1'

compile 'org.mapsforge:mapsforge-poi-android:0.7.0'
compile 'org.mapsforge:spatialite-android:0.7.0'
compile 'org.mapsforge:spatialite-android:0.7.0:natives-armeabi'
compile 'org.mapsforge:spatialite-android:0.7.0:natives-armeabi-v7a'
compile 'org.mapsforge:spatialite-android:0.7.0:natives-x86'

compile 'org.slf4j:slf4j-api:1.7.21'
compile 'org.slf4j:slf4j-android:1.7.21'

compile 'org.mapsforge:mapsforge-core:0.7.0'
compile 'org.mapsforge:mapsforge-poi:0.7.0'

Emux

unread,
Mar 8, 2017, 5:35:41 AM3/8/17
to mapsfo...@googlegroups.com
PoiSearchViewer is a sample using both Map and POI libraries.

So you'll need all the Map and POI dependencies in the project.

--
Emux

Mariel Basbas

unread,
Mar 8, 2017, 5:47:37 AM3/8/17
to mapsforge-dev
Thank you, I'll study how this code works. :)
Reply all
Reply to author
Forward
0 new messages