Ejemplo n.º 1
0
        public static List <Vector3> CoordsToVerts(IList geometry, bool withNoise, GOTileObj goTile)
        {
            var convertedGeometry = new List <Vector3>();

            for (int i = 0; i < geometry.Count; i++)
            {
                if (geometry.GetType() == typeof(List <LatLng>))                   //Mapbox
                {
                    LatLng      c      = (LatLng)geometry [i];
                    Coordinates coords = new Coordinates(c.Lat, c.Lng, 0);
                    Vector3     p      = goTile.coordinatesToVector(coords);

                    if (withNoise && i != 0 && i != geometry.Count - 1)
                    {
                        float noise = GOFeatureMeshBuilder.Noise();
                        p.x += noise;
                        p.z += noise;
                    }

                    convertedGeometry.Add(p);
                }
                else                     //Mapzen
                {
                    IList       c      = (IList)geometry[i];
                    Coordinates coords = new Coordinates((double)c[1], (double)c[0], 0);
                    convertedGeometry.Add(goTile.coordinatesToVector(coords));
                }
            }
            return(convertedGeometry);
        }
Ejemplo n.º 2
0
        public void ConvertPOIGeometries()
        {
            LatLng c = (LatLng)geometry [0];

            poiCoordinates = new Coordinates(c.Lat, c.Lng, 0);
            poiGeometry    = goTile.coordinatesToVector(poiCoordinates);
//			poiGeometry = poiCoordinates.convertCoordinateToVector ();
        }