For certain picture oriented apps I need to display big pictures and scrollable areas with further detail, once zoomed in.
In saw discussions and examples in iOS using CATiledLayer, which seems to do the job there.
Is there a CATiledLayer "port" or something similar for Android?
This library seems to be very good:
https://github.com/moagrius/TileView
I see you've started your own, but you may wish to check out OSMDroid, which is a full-featured library that supports existing online map tile systems, as well as locally-cached tiles and a rich overlay API. It even supports mini-maps.
Related
I have built a web based light SVG editor with simple functionalities such as (resize, rotate, dragging, coloring) using HTML canvas and fabricJS. Now just by curiosity i want to create a mobile app to this web based platform. started searching for alternatives or something similar to fabricJS in flutter but i had no luck.
Also searched for many solutions and i have never found something to serve this need in flutter or Native Android nor Swift, But I know it's possible there is canva who made something with the same approach but i couldn't find a way to know there secret sauce.
So, my direct question is if there an html canvas like in flutter and even a canvas-svg (and svg-canvas) parser.
Flutter doesn’t have SVG support and will never officially support it due to its performance.
Your best bet is to use CustomPaint for rendering the vector, then use SVG.js with js interop when it comes time to export the SVG. Not a simple solution since you’re having to work around lack of official support, but for basic functionality it should be completely feasible.
If you’re wanting to support importing vectors, you might want to check out flutter_svg’s code to take a look at how they handle SVG. This library only supports rendering SVGs, not manipulating or exporting them, but it may have some helpful code to point you in the right direction.
I wish to make an android app that leverages OSM services and runs an algorithm of my choice to find the route, say A* or some heuristic on Dijkstra.
The Routing wiki page of OSM has some good pointers but it does not give any insight about how to go about implementing your own algorithm in the app.
This response is overview which might help you to orient better in the landscape and find a way to approach the problem. Your question is too broad to give an exact simple answer but I do understand why are you asking such question.
You can use Osmdroid library to display the route you have on Android.
Keep in mind that the core feature of Osmdroid is to display the map tiles. Map tiles are just bitmaps so you need either an online source of tiles or an offline one. How to do that is covered in the documentation and partly in other questions on SO. It's a too big topic to explain it here in detail. Just to make it clear: .osm file with raw OpenstreetMap data cannot be directly rendered by Osmdroid. Map tiles are usually rendered from that data in quite complex way and not on the fly.
Another very important feature in Osmdroid library is the ability to display so called Overlays. E.g. Markers, polygons etc. You may use those to draw your route on the map and other features you may wish to display. This is again covered in the documentation and too big to go in details here.
There is a support for routing for Osmdroid (AFAIK in Osmbonuspack) but that's about using some 3rd party service to get your routing data and displaying that. According to your comment you want to implement your own algorithm and therefore this would be no use to you.
So the last part is how to integrate your algorithm into that. That's not a simple question with a simple answer. You'll need to do almost everything on your own, starting with getting the data you need to run the algorithm from the OpenstreetMap database (.osm file). I don't think there's an API which would provide you reasonable way to access the data in a form suitable for route computation. The approach I would choose is to develop some kind of preprocessing which would take either .osm file or a database with the data an produce my own structure representing the graph for navigation. I would than include this graph in my application and run my algorithm on that data. The output of my algorithm would be the route: a list of coordinates which I would use to draw the polyline.
If the area you need to cover is small enough, you may start with including the .osm file in your project and running the algorithm in the same was as you do now. Maybe it's going to be good enough for your situation.
One interesting project to look at to find inspiration is Graphopper - they have build exactly what I said above and they use it to provide a library for Android/iOs and a web API. But the core is the same - pre-process OSM data into graph data and run the algorithm on that. Since you wish to implement the algorithm on your own this library will not help you (unless you fork the project and modify it) but it might be a valuable learning resource.
I'm in need of a recommendation of a free AR library that will allow me to display location indicators (2D views) on top of a camera overlay (you probably know what I mean).
So far I've tried using this iOS library, but it seems to be out of shape since I did not get good results -> somehow the views got displaced and I did not grasp the math behind it.
I'm also in need of an Android version, but that can wait, so I'd like an iOS recommendation.
I've used BeyondAR on Android a couple of times and It works:
https://github.com/BeyondAR/beyondar
You just need to have the coordinates of the object to show and the image.
I would like to develop or use an existing platform that will allow me to view custom vector data and use it as a map on mobile phones such as Android/IPhone (Maybe even WP7).
I'm hoping that there's already a good infrastructure for what I need so I would not need to develop a whole infrastructure by myself.
In Conclusion -
Is there any existing platform that may answer my needs?
If not, how would you guys suggest I should begin? How should I save my vector data? How could I read it? Should I view it with a graphics engine like OpenGL? Is there any chance this solution could be cross-platform?
I know that it's possible since it was already done with apps like Waze. And it works the same on iOS and Android.
Thanks!
After much research I found a solution that fits most of my needs.
At the moment I decided to go on Android only so I'm using AndEngine (In the future I guess it would be pure OpenGL).
AndEngine can read .svg files and turn them into PNGs at runtime, and also has a built in support for ZoomCamera which allows me to pan and zoom the map very easily.
I'm converting the SVG to PNG because apparently mobile devices do not have a very good anti-aliasing support, and rendering curved paths can also be a problem.
I am a bit stuck with an idea of offline maps in android application.
I want to use Open Street Maps. But how can I redesign their styles and then use in my project? By the way, the resource, I am looking for, has to be free..
Are there any good tutorials about this? I am new to this, so would be thankful for any helpful information.
Here are the basics:
Raster tiles are awful. To my mind, this approach of mobile mapping is very old-fashioned and has no advantages (unless your plan is to make a very bad-looking application).
The other thing is vector tiles. All the data is saved in much more efficient way and can be displayed very beautifully.
And the solutions (nominees) are:
Mapsforge - thanks to #dkiselev
OSMAnd app - thanks to #dkiselev
Mapbox GL (the android version has no releases now, but they are working really hard on it). If you really like mapbox, you can think about
Mapbox Android SDK, which uses raster tiles, but I believe, that
switching to Mapbox GL will not be that hard, when the GL lib will be released.
AirBNB AirMapView - open source and has release version
Urban Labs Sputnik Demo - also interesting solution, but I didn't use it.
Mapzen Open - open source android app, that uses all the best from everywhere. - winner!
And by the way, mapbox gl actully allows rendering your own mapping data (from your own provider). There is a closed issue on github about that, opened by me couple of days ago, and very good answer by one of the project developers.
If you don't care about using your own data source and want to rapidly implement custom (not google/apple) maps into your project - there are dozens of solutions for you as well. You could think of Mapbox, Scobbler, GetYourMap or, again, just google it to find more. There is actually a great article on OSM website about most popular libraries and apps for android ever developed.
Finally, I wish you good luck with your mapping project. And never forget:
if you can't find something doesn't mean it really doesn't exist
- probably you've just been searching not enough.
Offline raster tiles cache
If you need to show your map offline with custom style, you may use any kind of OSM renders. http://wiki.openstreetmap.org/wiki/Rendering
For the case of several cities, I would recommend you http://wiki.openstreetmap.org/wiki/AlaCarte or http://wiki.openstreetmap.org/wiki/TileMill
Create your own style, and export map tiles to sqlite db archive.
After that, you will need to create your own TileProvider for OSMDroid library. This answer could help you How to use MOBAC created OSMDroid SQLite tile source file offline?
Offline vector tiles.
Getyourmap
If you need more than just rendering with custom style, you may use:
https://getyourmap.com/ it's OSM vector renderer. But there would be some problems with accessing raw data to create routing and searching.
OSMAnd
And maybe the hardest but the best way, is to use OSMAnd. It's open-source, there are lots of capabilities, but it's an application, not a component or library.
So if you want to create a stand alone app. you will need to cut off features which you don't need.
Mapsforge
https://github.com/saintbyte/mapsforge It's opensource so it would be possible to add routing and searching. Style, as I know may be customized, but I haven't try it.