Exemplo n.º 1
0
        private void DrawMapData(FeatureBasedMapData featureBasedMapData)
        {
            IFeatureBasedMapDataLayer featureBasedMapDataLayer = FeatureBasedMapDataLayerFactory.Create(featureBasedMapData);

            var drawnMapData = new DrawnMapData
            {
                FeatureBasedMapData      = featureBasedMapData,
                FeatureBasedMapDataLayer = featureBasedMapDataLayer
            };

            drawnMapData.Observer = new Observer(() =>
            {
                mapDataLayersToUpdate.Add(drawnMapData.FeatureBasedMapDataLayer);
                StartUpdateTimer();
            })
            {
                Observable = featureBasedMapData
            };

            drawnMapDataList.Add(drawnMapData);

            if (!Projection.Equals(featureBasedMapDataLayer.Projection))
            {
                featureBasedMapDataLayer.Reproject(Projection);
            }

            map.Layers.Add(featureBasedMapDataLayer);
        }
Exemplo n.º 2
0
        public void Create_MapPolygonData_ReturnMapPolygonDataLayer()
        {
            // Call
            IFeatureBasedMapDataLayer layer = FeatureBasedMapDataLayerFactory.Create(new MapPolygonData("test data"));

            // Assert
            Assert.IsInstanceOf <MapPolygonDataLayer>(layer);
        }
Exemplo n.º 3
0
        public void Create_OtherData_ThrowsNotSupportedException()
        {
            // Setup
            var testData = new TestFeatureBasedMapData("test data");

            // Call
            TestDelegate test = () => FeatureBasedMapDataLayerFactory.Create(testData);

            // Assert
            Assert.Throws <NotSupportedException>(test);
        }