示例#1
0
        public void PointNotOnLineString()
        {
            LineString lineString = GetLineString();

            bool contains = lineString.ContainsPosition(GetNotLiesOnLinePosition());

            Assert.IsFalse(contains);
        }
示例#2
0
        /// <summary>
        /// When map is clicked, iterates through all features in the feature list and shows the feature info menu if feature has been tapped
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnMapClicked(object sender, MapClickedEventArgs e)
        {
            FeatureList.ForEach((Feature feature) =>
            {
                bool ItemHit = false;

                if (feature.Geometry.Type == GeoJSONType.Polygon && Preferences.Get(Constants.MapDrawPolygonsKey, true))
                {
                    Polygon polygon = (Polygon)feature.Geometry;
                    ItemHit        |= polygon.ContainsPosition(new Position(e.Position.Longitude, e.Position.Latitude));
                }
                else if (feature.Geometry.Type == GeoJSONType.LineString && Preferences.Get(Constants.MapDrawLinesKey, true))
                {
                    LineString lineString = (LineString)feature.Geometry;
                    ItemHit |= lineString.ContainsPosition(new Position(e.Position.Longitude, e.Position.Latitude, 0));
                }

                if (ItemHit)
                {
                    _ = DisplayFeatureActionMenuAsync(feature);
                }
            });
        }