//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 18JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Creates a polyline from encoded strings of aggregated points and levels. * ZoomFactor and NumLevels these two values determine the precision * of the levels within an encoded polyline. * @param _color the _color of the polyline. * @param _weight Width of the line in pixels. * @param _opacity the _opacity of the polyline. * @param points a string containing the encoded latitude and longitude * coordinates. * @param ZoomFactor the magnification between adjacent sets of zoom levels * in the encoded levels string. * @param levels a string containing the encoded polyline zoom level groups. * @param NumLevels the number of zoom levels contained in the encoded * levels string. * @return Geo polyline object. */ public static GeoPolyline FromEncoded(int color, int weight, double opacity, String points, int zoomFactor, String levels, int numLevels) { ArrayList trk = PolylineEncoder.CreateDecodings(points); GeoLatLng[] array = new GeoLatLng[trk.Count]; var temp = trk.ToArray(); for (int i = 0; i < temp.Length; i++) { array[i] = (GeoLatLng)temp[i]; } GeoPolyline polyline = new GeoPolyline(array, color, weight, opacity); polyline._levels = PolylineEncoder.DecodeLevel(levels); polyline.ZoomFactor = zoomFactor; polyline.NumLevels = numLevels; return(polyline); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 18JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Creates a polygon from encoded strings of aggregated points and _levels. * _zoomFactor and _numLevels these two values determine the precision * of the _levels within an encoded polygon. * @param _strokeColor the color of the polygon. * @param _strokeWeight Width of the line in pixels. * @param _strokeOpacity the opacity of the polygon. * @param _fillColor the inner color of the polygon. * @param _fillOpacity the inner opacity of the polygon. * @param points a string containing the encoded latitude and longitude * coordinates. * @param _zoomFactor the magnification between adjacent sets of zoom _levels * in the encoded _levels string. * @param _levels a string containing the encoded polygon zoom level groups. * @param _numLevels the number of zoom _levels contained in the encoded _levels string. * @return Geo polygon object. */ public static GeoPolygon FromEncoded(int strokeColor, int strokeWeight, double strokeOpacity, int fillColor, double fillOpacity, String points, int zoomFactor, String levels, int numLevels) { ArrayList trk = PolylineEncoder.CreateDecodings(points); GeoLatLng[] array = new GeoLatLng[trk.Count]; var temp = trk.ToArray(); for (int i = 0; i < temp.Length; i++) { array[i] = (GeoLatLng)temp[i]; } GeoPolygon polygon = new GeoPolygon(array, strokeColor, strokeWeight, strokeOpacity, fillColor, fillOpacity); polygon._levels = PolylineEncoder.DecodeLevel(levels); polygon._zoomFactor = zoomFactor; polygon._numLevels = numLevels; return(polygon); }