/*******************************************************************************
 * Copyright 2014, 2020 gwt-ol
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package ol;

import ol.layer.Layer;
import ol.proj.Projection;
import ol.proj.ProjectionOptions;

/**
 *
 * @author Tino Desjardins
 *
 */
public class MapTest extends GwtOLBaseTestCase {

    public void testMapCreation() {

        injectUrlAndTest(() -> {

            ProjectionOptions projectionOptions = new ProjectionOptions();
            projectionOptions.setCode("EPSG:21781");
            projectionOptions.setUnits("m");

            Projection projection = new Projection(projectionOptions);

            ViewOptions viewOptions = new ViewOptions();
            viewOptions.setProjection(projection);
            View view = new View(viewOptions);

            Coordinate centerCoordinate = new Coordinate(660000, 190000);

            view.setCenter(centerCoordinate);
            view.setZoom(9);

            final MapOptions mapOptions = new MapOptions();
            mapOptions.setTarget("map");
            mapOptions.setView(view);

            Map map = new Map(mapOptions);
            assertNotNull(map);

            map.forEachFeatureAtPixel(new Pixel(100, 100), new FeatureAtPixelFunction() {

                @Override
                public boolean call(Feature feature, Layer layer) {
                    return false;
                }

            });

        });

    }

}

@@ -757,16 +757,108 @@
 ge ol;%0A%0A
+import elemental2.dom.DomGlobal;%0Aimport elemental2.dom.Element;%0Aimport elemental2.dom.Node;%0A
 import o
@@ -1040,66 +1040,303 @@
 lic 
-void testMapCreation() %7B%0A%0A        injectUrlAndTest(() -%3E %7B
+static final String MAP_ID = %22map%22;%0A%0A    public static final int MAP_SIZE_WIDTH = 800;%0A%0A    public static final int MAP_SIZE_HEIGHT = 600;%0A%0A    public void testMapCreation() %7B%0A%0A        injectUrlAndTest(() -%3E %7B%0A%0A            this.createAndAppendMapElement(MAP_ID, MAP_SIZE_WIDTH, MAP_SIZE_HEIGHT);
 %0A%0A  
@@ -1979,21 +1979,22 @@
 tTarget(
-%22map%22
+MAP_ID
 );%0A     
@@ -2119,260 +2119,897 @@
     
-map.forEachFeatureAtPixel(new Pixel(100, 100), new FeatureAtPixelFunction() %7B%0A%0A                @Override%0A                public boolean call(Feature feature, Layer layer) %7B%0A                    return false;%0A                %7D%0A%0A            %7D);%0A%0A        %7D
+assertNotNull(map.getSize());%0A%0A            assertEquals(MAP_SIZE_WIDTH, map.getSize().getWidth());%0A            assertEquals(MAP_SIZE_HEIGHT, map.getSize().getHeight());%0A%0A            FeatureAtPixelOptions featureAtPixelOptions = new FeatureAtPixelOptions();%0A%0A            map.forEachFeatureAtPixel(new Pixel(100, 100), new FeatureAtPixelFunction() %7B%0A%0A                @Override%0A                public boolean call(Feature feature, Layer layer) %7B%0A                    return false;%0A                %7D%0A%0A            %7D, featureAtPixelOptions);%0A%0A        %7D);%0A%0A    %7D%0A%0A    private Node createAndAppendMapElement(String id, int width, int height) %7B%0A%0A        Element mapDiv = DomGlobal.document.createElement(%22div%22);%0A        mapDiv.setAttribute(%22id%22, id);%0A        mapDiv.setAttribute(%22style%22, %22width: %22 + width + %22px; height: %22 + height + %22px%22);%0A%0A        return DomGlobal.document.body.appendChild(mapDiv
 );%0A%0A

Create map div for map test