Class deCarta.Mobile.Image
Images (which are inherited from deCarta.Mobile.OverlayObjects can be added to map overlays
(deCarta.Mobile.MapOverlay). An Image defines two positions on the map: topLeft and bottomRight,
which indicate the corners of the image on the map.
The image will scale when zoomed to maintain its position.
You can also provide a range for valid zoom levels at which to display the image.
Example:
var image = new deCarta.Mobile.Image({
topLeft: new deCarta.Mobile.Position(37, -122),
topRight: new deCarta.Mobile.Position(37.5, -122.5),
minZoom: 10,
maxZoom: 13,
src: 'prettyImage.jpg'
});
//assuming mapOverlay is a mapOverlay object, attached to a map
mapOverlay.addObject(image);
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
deCarta.Mobile.Image(options)
An OverlayObject used to display an Image on a MapOverlay
|
| Method Attributes | Method Name and Description |
|---|---|
|
Retrieve the geographic position of the top-left
corner of the image.
|
|
|
getSize()
Retrieves the size of the image, in meters
|
|
|
setPosition(position)
Sets the geographic position of the top-left
corner of the image.
|
Class Detail
deCarta.Mobile.Image(options)
An OverlayObject used to display an Image on a MapOverlay
- Parameters:
- {object} options
- Options. May contain one or more of the following:
- deCarta.Mobile.Position topLeft: Geographic position of the top-left of the image on the map - required
- deCarta.Mobile.Position btmRight: Geographic position of the bottom-right of the image on the map - required
- (int) minZoom: optional, default 1
- (int) maxZoom: optional, default 20
- (string) cssClass: css class that will be applied to the element
- (int) opacity: opacity of the image [0 (transparent) to 100 (opaque)] default=75
- (string) src: the image src, can be a reference to an image file or a data URI
Method Detail
{deCarta.Mobile.Position}
getPosition()
Retrieve the geographic position of the top-left
corner of the image.
- Returns:
- {deCarta.Mobile.Position} Geographic position of the top-left corner of the image
{width|height}
getSize()
Retrieves the size of the image, in meters
- Returns:
- {width|height} A structure containing width and height
setPosition(position)
Sets the geographic position of the top-left
corner of the image.
- Parameters:
- {deCarta.Mobile.Position} position
- Position of the top-left corner of the image