Class GisMap
java.lang.Object
nl.tudelft.simulation.dsol.animation.gis.map.GisMap
- All Implemented Interfaces:
GisMapInterface
Provides the implementation of a Map.
Copyright (c) 2020-2025 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
-
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLayer(LayerInterface layer) drawMap(Graphics2D graphics) org.djutils.immutablecollections.ImmutableList<LayerInterface>org.djutils.draw.bounds.Bounds2dgetImage()org.djutils.immutablecollections.ImmutableMap<String,LayerInterface> doubledoublegetName()doubledoubleorg.djutils.immutablecollections.ImmutableList<LayerInterface>voidvoidhideLayer(LayerInterface layer) booleanbooleanisSame()voidsetDrawBackground(boolean drawBackground) voidsetExtent(org.djutils.draw.bounds.Bounds2d extent) voidsetImage(MapImageInterface image) voidsetLayer(int index, LayerInterface layer) voidsetLayers(List<LayerInterface> layers) voidvoidvoidvoidshowLayer(LayerInterface layer) voidzoom(double zoomFactor) voidvoidzoomRectangle(Rectangle2D rectangle) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.tudelft.simulation.dsol.animation.gis.GisMapInterface
getMetersPerPixelX, getMetersPerPixelY
-
Constructor Details
-
GisMap
public GisMap(double metersPerUnitX, double metersPerUnitY) Construct a new Map, defining the size of a map unit in meters. The size of a map unit can then be used to draw scalable lines with a certain width, and to make certain features disappear if the meter-to-pixel ratio is passing a certain threshold. In WGS84 maps, typically the latitude is used, since it does not vary dependent on the location.- Parameters:
metersPerUnitX- the mapping of one map unit to the equivalent number of meters in the x-directionmetersPerUnitY- the mapping of one map unit to the equivalent number of meters in the y-direction
-
GisMap
public GisMap()Construct a new Map, with WGS84 as the scale definition, with values for the equator. One degree of latitude is approximately 111,120 meters, while one degree of longitude varies from approximately 111,120 meters at the equator to 0 meters at the poles.
-
-
Method Details
-
addLayer
- Specified by:
addLayerin interfaceGisMapInterface
-
setLayers
- Specified by:
setLayersin interfaceGisMapInterface
-
setLayer
- Specified by:
setLayerin interfaceGisMapInterface
-
hideLayer
- Specified by:
hideLayerin interfaceGisMapInterface
-
hideLayer
- Specified by:
hideLayerin interfaceGisMapInterface
-
showLayer
- Specified by:
showLayerin interfaceGisMapInterface
-
showLayer
- Specified by:
showLayerin interfaceGisMapInterface
-
isSame
public boolean isSame()- Specified by:
isSamein interfaceGisMapInterface
-
drawMap
- Specified by:
drawMapin interfaceGisMapInterface- Throws:
DsolGisException
-
getExtent
public org.djutils.draw.bounds.Bounds2d getExtent()- Specified by:
getExtentin interfaceGisMapInterface
-
getImage
- Specified by:
getImagein interfaceGisMapInterface
-
getAllLayers
- Specified by:
getAllLayersin interfaceGisMapInterface
-
getVisibleLayers
- Specified by:
getVisibleLayersin interfaceGisMapInterface
-
getLayerMap
- Specified by:
getLayerMapin interfaceGisMapInterface
-
getName
- Specified by:
getNamein interfaceGisMapInterface
-
getScaleX
public double getScaleX()- Specified by:
getScaleXin interfaceGisMapInterface
-
getScaleY
public double getScaleY()- Specified by:
getScaleYin interfaceGisMapInterface
-
getMetersPerUnitX
public double getMetersPerUnitX()- Specified by:
getMetersPerUnitXin interfaceGisMapInterface
-
getMetersPerUnitY
public double getMetersPerUnitY()- Specified by:
getMetersPerUnitYin interfaceGisMapInterface
-
getMapUnits
- Specified by:
getMapUnitsin interfaceGisMapInterface
-
setExtent
public void setExtent(org.djutils.draw.bounds.Bounds2d extent) - Specified by:
setExtentin interfaceGisMapInterface
-
setImage
- Specified by:
setImagein interfaceGisMapInterface
-
setName
- Specified by:
setNamein interfaceGisMapInterface
-
setUnits
- Specified by:
setUnitsin interfaceGisMapInterface
-
zoom
public void zoom(double zoomFactor) - Specified by:
zoomin interfaceGisMapInterface
-
zoomPoint
- Specified by:
zoomPointin interfaceGisMapInterface
-
zoomRectangle
- Specified by:
zoomRectanglein interfaceGisMapInterface
-
isDrawBackground
public boolean isDrawBackground()- Specified by:
isDrawBackgroundin interfaceGisMapInterface
-
setDrawBackground
public void setDrawBackground(boolean drawBackground) - Specified by:
setDrawBackgroundin interfaceGisMapInterface
-