示例#1
0
        public void DuplicateLayerNamesThrowsException()
        {
            Map map = new Map(_factories.GeoFactory);
            IFeatureProvider dataSource = DataSourceHelper.CreateFeatureDatasource(_factories.GeoFactory);

            map.AddLayer(new GeometryLayer("Layer 1", dataSource));
            map.AddLayer(new GeometryLayer("Layer 3", dataSource));
            map.AddLayer(new GeometryLayer("Layer 2", dataSource));
            Assert.Throws <DuplicateLayerException>(delegate { map.AddLayer(new GeometryLayer("Layer 3", dataSource)); });
        }
示例#2
0
        public void MapExtentsReflectTheUnderlyingLayersCorrectlyWhenUsingAddLayer()
        {
            Map map = new Map(_factories.GeoFactory);

            GeometryLayer layer = new GeometryLayer("Geom layer",
                                                    DataSourceHelper.CreateGeometryDatasource(_factories.GeoFactory));

            map.AddLayer(layer);
            IExtents box = map.Extents;

            Assert.Equal(_factories.GeoFactory.CreateExtents2D(0, 0, 120, 100), box);
        }