Package org.meteoinfo.layer
Class WebMapLayer
- java.lang.Object
-
- org.meteoinfo.layer.MapLayer
-
- org.meteoinfo.layer.WebMapLayer
-
public class WebMapLayer extends MapLayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebMapLayer.LanguageEditorclassWebMapLayer.WebMapLayerBeanstatic classWebMapLayer.WebMapLayerBeanBeanInfostatic classWebMapLayer.WebMapProviderEditor
-
Constructor Summary
Constructors Constructor Description WebMapLayer()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.RectanglecalculateViewportBounds(java.awt.Graphics2D g, int width, int height)Calculate view port boundsvoiddrawMapTiles(java.awt.Graphics2D g, int zoom, int width, int height)Draw the map tilesvoiddrawMapTiles(java.awt.Graphics2D g, int zoom, java.awt.Rectangle viewportBounds)Draw the map tiles.GeoPositiongetAddressLocation()java.awt.geom.Point2DgetCenter()Gets the current pixel center of the map.GeoPositiongetCenterPosition()A property indicating the center position of the mapjava.lang.StringgetLayerInfo()To stringjava.awt.ImagegetLoadingImage()A property for an image which will be display when an image is still loading.TileFactorygetTileFactory()Get the current factoryWebMapProvidergetWebMapProvider()Get web map providerintgetZoom()Gets the current zoom levelbooleanisDrawTileBorders()Indicates if the tile borders should be drawn.booleanisRestrictOutsidePanning()booleanisTileOnMap(int x, int y, java.awt.Dimension mapSize)voidrepaint()RepaintvoidsetAddressLocation(GeoPosition pos)voidsetAddressLocation(GeoPosition pos, int zoom)voidsetCenter(java.awt.geom.Point2D center)Sets the new center of the map in pixel coordinates.voidsetCenterPosition(GeoPosition geoPosition)A property indicating the center position of the mapvoidsetDrawTileBorders(boolean drawTileBorders)Set if the tile borders should be drawn.voidsetLoadingImage(java.awt.Image loadingImage)A property for an image which will be display when an image is still loading.voidsetRestrictOutsidePanning(boolean restrictOutsidePanning)voidsetTileFactory(TileFactory factory)Set the current tile factoryvoidsetWebMapProvider(WebMapProvider prov)Set web map providervoidsetZoom(int zoom)Set the current zoom level-
Methods inherited from class org.meteoinfo.layer.MapLayer
clone, getExtent, getFileName, getHandle, getLayerDrawType, getLayerName, getLayerType, getLegendScheme, getProjInfo, getShapeType, getTag, getTransparency, getVisibleScale, hasLegendScheme, isExpanded, isMaskout, isVisible, saveFile, saveFile, setExpanded, setExtent, setFileName, setHandle, setLayerDrawType, setLayerName, setLayerType, setLegendScheme, setMaskout, setProjInfo, setShapeType, setTag, setTransparency, setVisible, setVisibleScale, toString
-
-
-
-
Method Detail
-
getZoom
public int getZoom()
Gets the current zoom level- Returns:
- the current zoom level
-
setZoom
public void setZoom(int zoom)
Set the current zoom level- Parameters:
zoom- the new zoom level
-
getCenter
public java.awt.geom.Point2D getCenter()
Gets the current pixel center of the map. This point is in the global bitmap coordinate system, not as lat/longs.- Returns:
- the current center of the map as a pixel value
-
isRestrictOutsidePanning
public boolean isRestrictOutsidePanning()
-
setRestrictOutsidePanning
public void setRestrictOutsidePanning(boolean restrictOutsidePanning)
-
setCenter
public void setCenter(java.awt.geom.Point2D center)
Sets the new center of the map in pixel coordinates.- Parameters:
center- the new center of the map in pixel coordinates
-
setCenterPosition
public void setCenterPosition(GeoPosition geoPosition)
A property indicating the center position of the map- Parameters:
geoPosition- the new property value
-
getCenterPosition
public GeoPosition getCenterPosition()
A property indicating the center position of the map- Returns:
- the current center position
-
getTileFactory
public TileFactory getTileFactory()
Get the current factory- Returns:
- the current property value
-
setTileFactory
public void setTileFactory(TileFactory factory)
Set the current tile factory- Parameters:
factory- the new property value
-
getLoadingImage
public java.awt.Image getLoadingImage()
A property for an image which will be display when an image is still loading.- Returns:
- the current property value
-
setLoadingImage
public void setLoadingImage(java.awt.Image loadingImage)
A property for an image which will be display when an image is still loading.- Parameters:
loadingImage- the new property value
-
isDrawTileBorders
public boolean isDrawTileBorders()
Indicates if the tile borders should be drawn. Mainly used for debugging.- Returns:
- the value of this property
-
setDrawTileBorders
public void setDrawTileBorders(boolean drawTileBorders)
Set if the tile borders should be drawn. Mainly used for debugging.- Parameters:
drawTileBorders- new value of this drawTileBorders
-
setWebMapProvider
public void setWebMapProvider(WebMapProvider prov)
Set web map provider- Parameters:
prov- The web map provider
-
getWebMapProvider
public WebMapProvider getWebMapProvider()
Get web map provider- Returns:
- Web map provider
-
getAddressLocation
public GeoPosition getAddressLocation()
-
setAddressLocation
public void setAddressLocation(GeoPosition pos, int zoom)
-
setAddressLocation
public void setAddressLocation(GeoPosition pos)
-
repaint
public void repaint()
Repaint
-
drawMapTiles
public void drawMapTiles(java.awt.Graphics2D g, int zoom, int width, int height)Draw the map tiles- Parameters:
g- Graphics2Dzoom- Zoom level to draw atwidth- The widthheight- The height
-
drawMapTiles
public void drawMapTiles(java.awt.Graphics2D g, int zoom, java.awt.Rectangle viewportBounds)Draw the map tiles. This method is for implementation use only.- Parameters:
g- Graphicszoom- zoom level to draw atviewportBounds- View bounds
-
isTileOnMap
public boolean isTileOnMap(int x, int y, java.awt.Dimension mapSize)
-
calculateViewportBounds
public java.awt.Rectangle calculateViewportBounds(java.awt.Graphics2D g, int width, int height)Calculate view port bounds- Parameters:
g- Graphic2Dwidth- The widthheight- The height- Returns:
- View port bounds rectangle
-
getLayerInfo
public java.lang.String getLayerInfo()
To string- Overrides:
getLayerInfoin classMapLayer- Returns:
- String
-
-