Giter Club home page Giter Club logo

vectortileswithxamarinmaps's People

Contributors

bertt avatar ryanlowdermilk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bertt

vectortileswithxamarinmaps's Issues

using the UWP application to get .PBF extention tiles from a server

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.