ryanlowdermilk / vectortileswithxamarinmaps Goto Github PK
View Code? Open in Web Editor NEWA sample Android, iOS and Windows Universal app that maps vector tile data onto Xamarin Maps
A sample Android, iOS and Windows Universal app that maps vector tile data onto Xamarin Maps
Hi, Thanks for the sample on vector tiles with the nugget. Just a quick thing, I am using your solution to implement my own vector tiles returned from a server call. The below is my process tile code:
`private async Task ProcessTile(TileData t, Map m, int xOffset, int yOffset)
{
int x = t.X + xOffset;
int y = t.Y + yOffset;
string key = $"{x}_{y}";
if (MapStore.XY.ContainsKey(key))
{
return false;
}
else
{
MapStore.XY.Add(key, true);
}
Assembly assembly = GetType().GetTypeInfo().Assembly;
var stringUrl = $"http://MySomeServicePlaceholder/maps/v1/myKey/map_tile/v14_0_z4_ind/{t.Z}/{t.X}/{t.Y}.pbf";
Uri URL = new Uri(stringUrl);
using (var client = new HttpClient())
{
var requestMessage = new HttpRequestMessage(HttpMethod.Get, URL);
var responseMessage = await client.SendAsync((requestMessage));
var responseData = await responseMessage.Content.ReadAsStreamAsync();
if (responseData != null && responseData.Length > 0)
{
var layerInfos = VectorTileParser.Parse(responseData);
if (layerInfos.Count == 0)
return false;
var fc = layerInfos[0]?.ToGeoJSON(x, y, t.Z);
foreach (var geo in fc.Features)
{
var lng1 = ((GeoJSON.Net.Geometry.GeographicPosition)((GeoJSON.Net.Geometry.Point)geo.Geometry).Coordinates).Longitude;
var lat1 = ((GeoJSON.Net.Geometry.GeographicPosition)((GeoJSON.Net.Geometry.Point)geo.Geometry).Coordinates).Latitude;
m.Pins.Add(new Pin() { Position = new Position(lat1, lng1), Label = $"{lng1},{lat1}" });
}
}
else
return false;
}
return true;
}
`
The issue is it goes into the catch error section in the method Map_PropertyChanged
with the error message:
Message = "Invalid wire-type; this usually means you have over-written a file without truncating or setting the length; see http://stackoverflow.com/q/2152978/23354"
I did try and see the given link but couldn't get it through. Could you please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.