OSMBonusPack | party library of useful additional objects
kandi X-RAY | OSMBonusPack Summary
kandi X-RAY | OSMBonusPack Summary
A third-party library of (very) useful additional objects for [osmdroid] which is a library to interact with [OpenStreetMap] data inside an Android application. It offers an almost full/free replacement to Android map objects: MapView, MapController, Overlays, etc. IMPORTANT: Please note that this is only a copy of the official SVN repository to make it easier to include this library as a git submodule. Do not issue pull requests and go to [the official initiative] for up to date information and code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the road points
- Builds the leg information
- Builds the instructions for the roads
- Decode a Google - encoded polyline
- Search for POI search
- Convert a JSONObject to a GeoPoint object
- Retrieve elements in a KML folder
- Build a Geometry from a JSON object
- Draw the rectangle
- Precompute points
- Get a URL to search for a OSM tag
- Generate a path along with the given parameters
- Gets an address from a GeoJSON representation
- Draw the shadow
- Get the road points
- Fetch the thumbnail
- Get a URL to retrieve a URL for a specific OSM tag
- Retrieves the GeoNames XML from the GeoNames API
- Parse a string of geo coordinates
- Download a file from the given tile source
- Handles the end of an XML element
- Returns the clustering of the grid
- Creates a new GroundOverlay with the given coordinates
- End element
- Parses a KMZ file
- Use this API to retrieve an address from a specified location
OSMBonusPack Key Features
OSMBonusPack Examples and Code Snippets
Community Discussions
Trending Discussions on OSMBonusPack
QUESTION
I need to force OSRM to switch the language in road.mNodes.mInstructions
to English in order to work with English TTS. How do I achieve that in Kotlin? I'm using OSRMRoadManager from OSMBonusPack.
ANSWER
Answered 2022-Feb-23 at 13:18I don't see an obvious answer. Basically, you need to change the way DIRECTIONS hashmap is initialized.
Suggestion : you could subclass OSRMRoadManager, adapting buildInstructions(int maneuver, String roadName), to use your own DIRECTIONS object.
If you see a simple change to do inside the lib (adding a "language" option somewhere), don't hesitate to push a PR.
QUESTION
UPDATE to question:
If we are running our own database and tile server, do we also need to run our own instance of OSRM to get routing via OSMDroid using OSRMRoadManager
? OR if not running our own, pull from another OSRM instance somewhere?
We are setting up an instance of Open Street Map data and a tile server on our own server, that will provide data for a mobile app.
My question is about routing: is there reason to set up Open Street Routing Machine / OSRM (http://project-osrm.org) vs using something like OSMDroid (https://github.com/osmdroid/osmdroid) or OSMBonusPack (https://github.com/MKergall/osmbonuspack)? OSRM seems to have some pretty heavy server requirements, but will it have other benefits, perhaps by keeping things easier on the front end?
We are creating our own OSM server with the hope/expectation that we will start generating large amounts of traffic, and we are trying to understand the best strategy for the routing. Most of the traffic will be through either our mobile app or mobile browsers. For the routing, we don't really need much more than a polyline connecting start and end points via some reference points that will we determine to force the route through certain streets. Thanks for any help strategizing this out.
...ANSWER
Answered 2020-Aug-20 at 16:11OK, so I figured it out. Hopefully my confusion will help others find out this answer more quickly.
For connecting a different tile service just for visualization, there is already a class XYTileSource.java
in OSMDroid. But for getting to your own routing data (your own instance of OSRM) via the OSMBonusPack, you work with the class OSRMRoadManager
, perhaps changing the string that points to the OSRM demo site, but also just using setService()
with the url to your own OSRM server.
QUESTION
After upgrading from osmdroid:6.03, mapsforge 0.8, osmbonuspack 6.4 to the newest versions, I can work with both the v4 and v5 Mapsforge maps. Thank you so much for thes great libraries I use for 6 years!
Everything is working fine. When not moving the yellow man is drawn, but when moving the direction arrow turns out to be WHITE. When moving I can see that the center of the map is redrawn and thus changing. How can I change the arrow back to a more visible arrow?
These are the versions of the libraries:
...ANSWER
Answered 2020-Mar-23 at 16:19About 1.5 years ago the standard yellow man (current position) and green direction arrow were removed from the Osmdroid package. They changed this icon because they only had one dpi version and not having a version for each dpi folder (h,m,xh,xxh,xxxh).
So, you have to add your own version. Advised was to take from material.io the two-tone "navigation" 48 version for the direction arrow. When you change the direction arrow, as shown below, you also need to provide an icon for the current location.
After retrieving those items, I converted them to bitmaps. You can use online tools for that like www.online-convert.com.
Finally you can add the following code to your app:
QUESTION
I am currently building an Android app for firefighters in which I am using osmdroid
to create an editable map view. On OSM there are tags you can activate to show certain types of points of interest, and especially there are tags for firefighters (https://wiki.openstreetmap.org/wiki/Key:emergency), that seems essential for my app.
I looked at OSMbonuspack's POIs, but that only works for building types, and I didn't find an option for those in osmdroid
.
Does anyone know of a way to do it?
...ANSWER
Answered 2020-Mar-13 at 09:02You can use OSMBonusPack's OverpassAPIProvider to show POIs with any tags you like. The KML example shows how to display speed cameras (highway=speed_camera
). For showing firefighter features just replace it with amenity=fire_station
, emergency=fire_hydrant
or similar tags.
QUESTION
On an OpenStreetMap map with osmDroid and osmBonusPack I display markers and by clicking on it a bubble opens, everything works as I want up to a certain number of markers. The more markers I put on the map, the less responsive the application is. For example with 1000 markers, it takes 6 seconds for the Toolbar menu to appear and as much for moving to another activity such as a simple text display. My code.
...ANSWER
Answered 2020-Feb-13 at 16:13Markers are quite heavyweight or at least they have been some time ago when I had similar performance issues as you have. There might be a potential to optimize them, but that would mean modifying the Osmdroid library and creating a pull request with such changes.
Try to do some profiling to make sure the problem is not in your code but in the library (https://developer.android.com/studio/profile/cpu-profiler.html).
Pay attention to how you read the data from the databse - don't do it on main thread and measure how long it takes to make sure it's not the main issue.
Try SimpleFastPointOverlay from Osmdrid - it is supposed to be optimized for higher numbers of Markers (they have to have the same icon, though). Even if its not flexible enough for your needs, try it out to verify Markers are the real problem. After that you can look at the source code and use it as a learning material to implement your own custom Overlay.
QUESTION
I want to search for locations in a searchview and display the location on a map with a marker. When the marker is clicked, I want to show a infowindow with the location name, etc. I use OSMDROID and the OSMBONUSPACK.
The Problem:
The marker is shown as intented and its onClickListener does fire, but the infowindow is not shown if I call my searchLocationOnMap
from onQueryTextSubmit
. How to fix that?
Does not work(no info window shown if marker is clicked):
...ANSWER
Answered 2020-Jan-02 at 10:41I solve it with something like this
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OSMBonusPack
You can use OSMBonusPack like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the OSMBonusPack component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page