public void CanAddElement()
        {
            // ARRANGE
            var way = CreateWay();

            // ACT
            _editor.Add(way);

            // ASSERT
            var results = _elementSource.Get(_boundingBox, MapConsts.MaxZoomLevel).ToArray().Wait();
            var result  = results.OfType <Way>().Single(w => w.Id == way.Id);

            AssertWays(way, result);
        }
예제 #2
0
        /// <summary> Adds way model to element source and scene. </summary>
        private void AddWayModel(long id, List <Vector2d> footprint, TagCollection tags)
        {
            EnsureElementSource(footprint.First());
            var nullPoint = _tileController.CurrentTile.RelativeNullPoint;

            var way = new Way()
            {
                Id          = id,
                Tags        = tags,
                Coordinates = footprint.Select(p => GeoProjection.ToGeoCoordinate(nullPoint, p)).ToList()
            };

            _elementSourceEditor.Add(way);
            way.Accept(new WayVisitor(_tileController.CurrentTile, _modelLoader, _objectPool));
        }