A panel with a map generated from a tile source.
ButtonDownFcn | function | Mouse-click callback |
contrast | number between 0 and 100. | Number from 0-100 fading factor for the background 100 displays the original image, 0 image is faded away completely |
currentPoint | number[2,3] | Location of mouse pointer |
EXPERIMENTAL | boolean, default value: false. | Toggle between alphadata and contrast factor for testing |
handle (Read-only) | Handle of the uipanel in which the map is displayed. | |
hittest | string | Respond to captured mouse clicks |
MAXTILES | integer | Maximum number of tiles to store in the array of tiles. |
PickableParts | Ability to capture mouse clicks | |
type | string | For inspection. |
UIContextMenu | ContextMenu | |
WGS84Corners | /ows:WGS84Corners | When zooming out to maximum extent, zoom out to bounding box, or box around plotted items, whatever is larger. copied from: <ows:WGS84Corners> <ows:LowerCorner>-1.65729160235431 48.0405018704265</ows:LowerCorner> <ows:UpperCorner>11.2902578747914 55.9136415748388</ows:UpperCorner> |
xlim | number[2] | Minimum and maximum x-axis limits |
ylim | number[2] | Minimum and maximum y-axis limits |
ZLim | number[2] | ZLim of layer axis |
DELETE Delete a handle object. DELETE(H) deletes all handle objects in array H. After the delete function call, H is an array of invalid objects. See also MODELIT.MAPVIEWER.MAPVIEWER, MODELIT.MAPVIEWER.MAPVIEWER/ISVALID, CLEAR Help for modelit.mapviewer.MapViewer/delete is inherited from superclass handle
A panel with a map generated from a tile source.
obj = MapViewer(parent, varargin)
parent | handle | parent Figure |
varargin | any | property-value pairs with valid properties for a uipanel or the MapViewers tilesource. |
obj | any | modelit.mapviewer.MapViewer |
m = modelit.mapviewer.MapViewer(gcf, 'visible', 'off'); setVisibleRectangle(m, [ 2.4558 50.7183 5.7675 2.6999]); COMPABILITY WITH AXES, MIGRATION ISSUES In many cases an application can be ported from "axes" based to "MapViewer" based by only replacing "axes" with "MapViewer" and making sure all line, text and patch command explictly specify the parent object. This makes sure that MapViewer methods line, text and patch are invoked. There are a view extra things to look out for. -1- A mapViewer object is not a Handle Graphics object. Its handle cannot be gound through findobj -2- Although MapViewer overloads plotting commands like line, patch and text, it does not automatically overload the set command for these objects. Example: h=line( ...'parent',map) set(h,'xdata',x,'ydata',y) This will not result in transforming x and y correctlty -3- Using "get" on object that are plotted ia MapViewer may not give a usefull result. Examples: get(h,'parent') returns axes handle, not MapViewer object. Tip: use HWIN=ancestor(hax,'figure') instead. het(h,'xdata') returns pixel coordinates not "real" coordinates -4- Only properties that are common to axes and uipanel can be used in a call to MapViewer. Documentation for modelit.mapviewer.MapViewer/MapViewer doc modelit.mapviewer.MapViewer
Return handle of data axes in mapviewer object (added 20210115)
Export WGS property of tile source
Transforms latitude coordinate to pixel coordinate y
Transforms longitude coordinate to pixel coordinate x
Transforms pixel coordinate Y to latitude
Transforms pixel coordinate X to longitude.
Create a context menu that can be added to layer selector
Set the source from which the map tiles are retrieved.
setTilesource(obj, value)
obj | modelit.mapviewer.Mapviewer | |
value | modelit.mapviewer.AbstractTileSource |
No output.
Set contrast of tiles.
setContrast(obj, value)
obj | modelit.mapviewer.Mapviewer | |
value | number | between 0 completely white or 100 no fading at all. |
No output.
setControls - show or hider zoom buttons
Redirect to layer.
Redirect findobj to axes created by MapViewer, so that line object can be found using tag.
Redirect to Modelit lm_linkobj.
Redirect to Modelit zoomtool.
Callback of the zoombuttons.
zoomCallback(obj, mode)
obj | modelit.mapviewer.MapViewer | |
mode | string | 'zoomin' or 'zoomout' |
No output
Get tile from cache or from server.
tile = findTile(obj, x, y, zoomlevel)
obj | modelit.mapviewer.MapViewer | |
x | any | Integer |
y | any | Integer |
zoomlevel | any | Integer with zoomlevel. |
tile | any | modelit.mapviewer.Tile or a string with the tile url if the Tile has not been loaded yet. |
Resize function of uipanel that holds map. Reposition axes and adjust axes' xlim and ylim.
tile = reposition(obj)
obj | modelit.mapviewer.MapViewer |
No output.
Get index and zoomlevel of the tiles that are in the current view.
tile = getTilesInView(obj)
obj | modelit.mapviewer.MapViewer |
S | any | [Nx3] matrix with [x y zoomlevel]. |
Set the cdata and alpha of a tile. The current cdata wa set to "hourglass"
Executed when a new image has been downloaded.
Executed when there is a progress event from the worker.
Executed when a request for a new Tile has failed.
Executed when a new tile is about to be downloaded. I.e. the threadpoolexecutor started the download. A new tile with an hourglass is created in this function.
Repaint tiles by downloading and displaying map images.
repaint(obj)
obj | any | modelit.mapviewer.MapViewer |
No output.
Function called in case of "pan" action
zoomtool_move(obj, ISSCALE)
obj | any | modelit.mapviewer.MapViewer |
No output.
Plot text on the map.
h = text(xdata, ydata, varargin) h = text(xdata, ydata, zdata, varargin)
varargin | any | Parameter-value pairs with valid text properties. |
h | any | Handle of the text object. |
Plot an image on the map.
any valid syntax to invoke image. Except "image(Cdata)"
varargin | any | Parameter-value pairs with valid patch properties. |
h | any | Handle of the image. |
Plot a patch on the map.
h = patch(xdata, ydata, varargin) h = patch(xdata, ydata, zdata, varargin)
varargin | any | Parameter-value pairs with valid patch properties. |
h | any | Handle of the patch. |
Plot a line on the map.
h = line(xdata, ydata, varargin) h = line(xdata, ydata, zdata, varargin)
varargin | any | Parameter-value pairs with valid line properties. |
h | any | Handle of the plotted line. |
Get x or y data from object in the map.
val = getxydata(obj, h, prop)
obj | modelit.mapviewer.Mapviewer | |
h | any | handle of line, patch or image |
prop | any | valid object property. |
val | any | Value of property. |
Set x or y data of object in the map.
setxydata(obj, h, varargin)
obj | modelit.mapviewer.Mapviewer | |
h | any | handle of line, patch or image |
varargin | any | name value pairs. These will be transferred to hg oobject h, with the exception of xdata and ydata. these will be transformed first. |
Clear the axis with lines, patches and text.
cla(obj)
obj | modelit.mapviewer.Mapviewer |
No direct output, the layer with lines, patches etc is active
Activate axis with lines, patches and text.
axes(obj)
obj | modelit.mapviewer.Mapviewer |
No direct output, the layer with lines, patches etc is active.
Set the zoomlevel.
setZoomlevel(obj, zoomlevel)
obj | any | modelit.mapviewer.MapViewer |
zoomlevel | any | Integer with zoomlevel. |
No output
Get the zoomlevel.
zoomlevel = getZoomlevel(obj)
obj | any | modelit.mapviewer.MapViewer |
zoomlevel | any | Integer with zoomlevel. |
Set pivot at relative coordinate xn, yn to coordinate lon, lat.
setPivotCenter(obj, lon, lat, xn, yn, REPAINT)
obj | any | modelit.mapviewer.MapViewer |
lon | any | Double with longitude of center of the view. |
xn | any | |
yn | any | |
lat | any | Double with latitude of center of the view. |
REPAINT | boolean | if true then repaint the MapViewer. |
No output
Set center of view.
setCenter(obj, lon, lat, REPAINT)
obj | any | modelit.mapviewer.MapViewer |
lon | any | Double with longitude of center of the view. |
lat | any | Double with latitude of center of the view. |
REPAINT | boolean | if true then repaint the MapViewer. |
No output
Get center of view.
[lon, lat] = getCenter(obj)
obj | any | modelit.mapviewer.MapViewer |
lon | any | Double with longitude of center of the view. |
lat | any | Double with latitude of center of the view. |
Set center and zoomlevel such that the given rectangle is completely visible.
setVisibleRectangle(obj, rect)
obj | any | modelit.mapviewer.MapViewer |
rect | any | [left bottom width height] in latitude and longitude. |
REPAINT | any | If false, calling module will do repaint. Skip repaint here. |
No direct output, the given rectangle is completely visible.
Get current view rectangle.
rect = getVisibleRectangle(obj, zm)
obj | any | modelit.mapviewer.MapViewer |
zm | any | <number> zoomlevel |
rect | any | [left bottom width height] in latitude and longitude. |
Get current coordinates of Mapviever viewport.
box = getVisibleBox(obj, zm)
obj | any | modelit.mapviewer.MapViewer |
zm | any | <integer> optional, with the zoomlevel, default obj.zoomlevel |
box | any | [xlim(1) xlim(2) ylim(1) ylim(2)] in local coordinate system. |
set viewport though lower-left and upper-right corner
get local coordinates of lower-left and upper-right corner of Mapviewer viewport.
Get hg ancestor of this panel.
P = ancestor(obj, varargin)
obj | any | modelit.mapviewer.MapViewer |
p | any | handle with this panel's hg object. |
Remove a tile with given index from the array of tiles.
removeTile(obj, index)
obj | any | modelit.mapviewer.MapViewer |
index | any | Integer with index in obj.tiles of the tile to be removed. |
No output.
Add tile to array of tiles in the MapViewer.
addTile(obj, tile)
obj: <modelit.mapviewer.MapViewer> %
tile | modelit.mapviewer.Tile | the tile to add to the array of tiles in the MapViewer. |
No output
Position zoombuttons in MapViewer.
positionZoombuttons(obj, dummy, event)
obj | any | modelit.mapviewer.MapViewer |
dummy | any | default Matlab callback argument, not used. |
event | any | Callback event, with information on the new position of the MapViewer axis. |
No output