Package nl.tudelft.simulation.dsol.animation.gis.map

## Class GisMap

- java.lang.Object
- - nl.tudelft.simulation.dsol.animation.gis.map.GisMap

All Implemented Interfaces:
  `Serializable`, `GisMapInterface`

    public class GisMap
    extends Object
    implements GisMapInterface

Provides the implementation of a Map.

Copyright (c) 2020-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information DSOL Manual. The DSOL project is distributed under a three-clause BSD-style license, which can be found at DSOL License.

The dsol-animation-gis project is based on the gisbeans project that has been part of DSOL since 2002, originally by Peter Jacobs and Paul Jacobs.

Author:
  Alexander Verbraeck
See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface nl.tudelft.simulation.dsol.animation.gis.GisMapInterface

`AIRPHOTO, ANGLEDEG, ANGLERAD, CENTIMETER_PER_INCH, DD_TO_METER, FEET_TO_METER, IMAGE, INCH_TO_METER, KILOMETER_TO_METER, LINE, MILES_TO_METER, POINT, POLYGON, TEXT`

### Constructor Summary

Constructors
`GisMap()` constructs a new Map.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addLayer​(LayerInterface layer)`
`Graphics2D` `drawMap​(Graphics2D graphics)`
`ImmutableList<LayerInterface>` `getAllLayers()`
`Bounds2d` `getExtent()`
`MapImageInterface` `getImage()`
`ImmutableMap<String,​LayerInterface>` `getLayerMap()`
`String` `getName()`
`double` `getScale()`
`double` `getUnitImageRatio()` returns the scale of the Image.
`MapUnits` `getUnits()`
`ImmutableList<LayerInterface>` `getVisibleLayers()`
`void` `hideLayer​(String layerName)`
`void` `hideLayer​(LayerInterface layer)`
`boolean` `isDrawBackground()`
`boolean` `isSame()`
`void` `setDrawBackground​(boolean drawBackground)`
`void` `setExtent​(Bounds2d extent)`
`void` `setImage​(MapImageInterface image)`
`void` `setLayer​(int index, LayerInterface layer)`
`void` `setLayers​(List<LayerInterface> layers)`
`void` `setName​(String name)`
`void` `setUnits​(MapUnits units)`
`void` `showLayer​(String layerName)`
`void` `showLayer​(LayerInterface layer)`
`void` `zoom​(double zoomFactor)`
`void` `zoomPoint​(Point2D pixelPosition, double zoomFactor)`
`void` `zoomRectangle​(SerializableRectangle2D rectangle)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GisMap

    public GisMap()

constructs a new Map.

### Method Detail

#### addLayer

    public void addLayer​(LayerInterface layer)

Specified by:
  `addLayer` in interface `GisMapInterface`

#### setLayers

    public void setLayers​(List<LayerInterface> layers)

Specified by:
  `setLayers` in interface `GisMapInterface`

#### setLayer

    public void setLayer​(int index,
                         LayerInterface layer)

Specified by:
  `setLayer` in interface `GisMapInterface`

#### hideLayer

    public void hideLayer​(LayerInterface layer)

Specified by:
  `hideLayer` in interface `GisMapInterface`

#### hideLayer

    public void hideLayer​(String layerName)
                   throws RemoteException

Specified by:
  `hideLayer` in interface `GisMapInterface`
Throws:
  `RemoteException`

#### showLayer

    public void showLayer​(LayerInterface layer)

Specified by:
  `showLayer` in interface `GisMapInterface`

#### showLayer

    public void showLayer​(String layerName)
                   throws RemoteException

Specified by:
  `showLayer` in interface `GisMapInterface`
Throws:
  `RemoteException`

#### isSame

    public boolean isSame()
                   throws RemoteException

Specified by:
  `isSame` in interface `GisMapInterface`
Throws:
  `RemoteException`

#### drawMap

    public Graphics2D drawMap​(Graphics2D graphics)
                       throws DSOLGisException

Specified by:
  `drawMap` in interface `GisMapInterface`
Throws:
  `DSOLGisException`

#### getExtent

    public Bounds2d getExtent()

Specified by:
  `getExtent` in interface `GisMapInterface`

#### getImage

    public MapImageInterface getImage()

Specified by:
  `getImage` in interface `GisMapInterface`

#### getAllLayers

    public ImmutableList<LayerInterface> getAllLayers()

Specified by:
  `getAllLayers` in interface `GisMapInterface`

#### getVisibleLayers

    public ImmutableList<LayerInterface> getVisibleLayers()

Specified by:
  `getVisibleLayers` in interface `GisMapInterface`

#### getLayerMap

    public ImmutableMap<String,​LayerInterface> getLayerMap()
                                                          throws RemoteException

Specified by:
  `getLayerMap` in interface `GisMapInterface`
Throws:
  `RemoteException`

#### getName

    public String getName()

Specified by:
  `getName` in interface `GisMapInterface`

#### getScale

    public double getScale()

Specified by:
  `getScale` in interface `GisMapInterface`

#### getUnitImageRatio

    public double getUnitImageRatio()

returns the scale of the Image.

Specified by:
  `getUnitImageRatio` in interface `GisMapInterface`
Returns:
  double the unitPerPixel

#### getUnits

    public MapUnits getUnits()

Specified by:
  `getUnits` in interface `GisMapInterface`

#### setExtent

    public void setExtent​(Bounds2d extent)

Specified by:
  `setExtent` in interface `GisMapInterface`

#### setImage

    public void setImage​(MapImageInterface image)

Specified by:
  `setImage` in interface `GisMapInterface`

#### setName

    public void setName​(String name)

Specified by:
  `setName` in interface `GisMapInterface`

#### setUnits

    public void setUnits​(MapUnits units)

Specified by:
  `setUnits` in interface `GisMapInterface`

#### zoom

    public void zoom​(double zoomFactor)

Specified by:
  `zoom` in interface `GisMapInterface`

#### zoomPoint

    public void zoomPoint​(Point2D pixelPosition,
                          double zoomFactor)

Specified by:
  `zoomPoint` in interface `GisMapInterface`

#### zoomRectangle

    public void zoomRectangle​(SerializableRectangle2D rectangle)

Specified by:
  `zoomRectangle` in interface `GisMapInterface`

#### isDrawBackground

    public boolean isDrawBackground()

Specified by:
  `isDrawBackground` in interface `GisMapInterface`

#### setDrawBackground

    public void setDrawBackground​(boolean drawBackground)

Specified by:
  `setDrawBackground` in interface `GisMapInterface`