Nutiteq GPS tracking
iam a newbie for this kind of development. im trying to create an android application which involves G开发者_如何学JAVAPS tracking. i am using Nutiteq because i have to use openstreetmap as the default map. please help me.
What do you mean by GPS tracking? If it is showing GPS location on map, then Nutiteq sample project (https://github.com/nutiteq/hellomap3d/) has several samples: a) Simpler HelloMap3D demo has line-based animated GPS display, this is easier to use b) AnimatedLocationActivity in AdvancedMap3D shows OpenGL-based animation for more advanced requirements
If you want to save locations and show tracks as lines or points, then you need a bit extra work. I would save data to Spatialite database. Same hellomap3d project has Spatialite layer for viewing, but there is also SpatialLiteDbHelper.java which has method insertSpatiaLiteGeom() which enables to save data persistently to the database, this is something you need to implement in your app. For viewing lines and points there is existing sample code: see VectorFileMapActivity.java.
GPS tracks tend to become long and slow to render. For this there is special method to simplify data: use something like in VectorFileMapActivity:
dataSource.setAutoSimplify(2, metrics.widthPixels);
This tells that line data (it does not apply to points) will be simplified based on map zoom, while after zoom in you will see full data (for smaller map area). This will enable to show GPS trakcs if you have many of them visible with thousands of points.
The Open GPS Tracker project uses open street map. Have a glance on their sources.
精彩评论