Closed florinmarica closed 6 years ago
There are two things you need to make sure you did on the mobile devices:
About the contraction there is more info here:
http://docs.itinero.tech/docs/itinero/basic-concepts/routerdb.html#contraction
About the no-cache thing, that's here:
http://docs.itinero.tech/docs/itinero/basic-concepts/routerdb.html#memory-mapped
About OsmSharp and it's UI, it's not supported anymore. We recommend you use Mapsui, it's way better and it's very actively maintained, it's the better choice :+1:
Thank you very much for the fast response. Now the route calculate very nice and fast. i will try the mapsui and see how it works. Thank you again!
I switched to Mapsui and when i deserialize the routerdb file it's throw this exception "Cannot deserialize routing db: Invalid version #: 9.". The routerdb was created from osm.pbf with winforms itinero.
Make sure you install the same packages... you can only use a router db in a later or equal Itinero version compared to the version it was created with.
Yes thank you, sorry for that, i use 14.0-pre53 for serialize. How can i add the route to mapsui map? i can't find anything.
There is no standard way but me and @pauldendulk have been discussing making a sample. I guess for now you have to convert the route object to a linestring and then you can add it to the map.
Correct me if I'm wrong @pauldendulk
It has been on my todo list for far too long. Ben, could you give me a few pointers. What is the todo list. Add the itinero nuget package. A specific one? What data to use? Which commands will I need?
I think if we start with a sample on how to show a route on the map them we're fine for now.
Later I would move to using the routing data to also try to render a basemap or at least an overlay on detailed zoom levels.
Ok. Let s do that. So which package do I use?
This is how i try to add the route to map, but i think i do something wrong because it doesn't show.
private ILayer LayerRouteW(Route route)
{
List
Edit: i find out that the Points need spherical coordinates and it works.
private ILayer LayerRouteW(Route route)
{
List
@florinmarica What is this List p = new List();
? Reminiscence.Collections? What does your using look like?
I am trying to get started, help me out: https://github.com/Mapsui/Mapsui/blob/master/Samples/Mapsui.Samples.Common/Maps/ItineroRoutingSample.cs
i think the text was formated I'm using: List< Point > p = new List< Point >(); - Generic list
/* using Android.App; using Android.OS; using Android.Support.V7.App; using BruTile.MbTiles; using Itinero; using Itinero.LocalGeo; using Mapsui; using Mapsui.Geometries; using Mapsui.Layers; using Mapsui.Projection; using Mapsui.Providers; using Mapsui.Styles; using Mapsui.UI.Android; using SQLite;
*/
Don't use Reminiscense, that's just for Itinero use only... The code looks good, just add whatever is in the shape array to the map.
@pauldendulk Just installing the base Itinero package should be enough. If you want to load data from OSM in your sample all then also add Itinero.IO.Osm and you can load OSM data.
@xivk @florinmarica My remark about reminiscense was just confusion that arose because something had gone wrong when pasting.
@florinmarica If you use code then put it between back tics, these, top left keyboard: ` https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting
@xivk Could I do routing without data?
Now it compiles https://github.com/Mapsui/Mapsui/blob/master/Samples/Mapsui.Samples.Common/Maps/ItineroRoutingSample.cs
private ILayer LayerRouteW(Route route)
{
List<Point> p = new List<Point>();
foreach (Coordinate coordinate in route.Shape)
{
var spherical = SphericalMercator.FromLonLat(coordinate.Longitude, coordinate.Latitude);
p.Add(new Point(spherical.X, spherical.Y));
}
LineString ls = new LineString(p);
Feature f = new Feature
{
Geometry = ls,
["Name"] = "Line 1",
Styles = new List<IStyle> { new VectorStyle { Line = new Pen(Color.Blue, 6) } }
};
return new MemoryLayer
{
Name = "Route",
DataSource = new MemoryProvider(f),
Style = null
};
}
Work is now ongoing in the Mapsui repo, getting back to this once 1.4 is released.
ok
Hello! I'm trying to create a Xamarin Android app with offline map and routing using Osmsharp and Itinero. I have a lot of problems with the plugins, i don't know if i'm doing the right way but i can't find an complete example. My main 2 problems are:
Thanks!