Important version information!

You are browsing a class reference for Version 2 of the JavaScript Charts. If you are using Version 3 (current), please click here.

MapImage

Inheritance: MapImageMapObject

MapImage is a class where properties of images are defined.
MapImage can display external svg, png, jpg or gif files.
There are 3 predefined images: circle, rectangle and bubble.
You can also pass an svg path (this is the most flexible way to have images).
MapImage can also display labels.
In case some property is not defined in this class, MapMovie will use MoviesSettings class property with the same name.

Properties Hide inherited

PropertyTypeDefaultDescription
alphaNumberOpacity of map object.
balloonTextStringText which is displayed in a roll-over balloon. You can use the following tags: [[title]], [[description]], [[value]] and [[percent]].
balloonTextStringText which is displayed in a roll-over balloon. You can use the following tags: [[title]], [[description]], [[value]] and [[percent]].
bottomNumberDistance from bottom of a map container to the image. If centered property is false, then the distance is measured to the bottom of the image, otherwise - to the center. If you set this property, value of top property is ignored. This property can be set as a number (of pixels) or as a percent value, like: image.bottom = "10%";. The image will not be bounded to the map if this property is set. Use latitude and longitude properties if you want the image to move with the map.
centeredBooleanSpecifies if the image's center should be placed in the provided coordinates. If false, top-left corner will be at provided coordinates. This property doesn't work with images set as svgPath.
colorStringColor of MapObject
colorStringColor of MapObject
customDataObjectA custom data holder.
descriptionStringDescription of MapObject. Description is displayed in DescriptionWindow (when user clicks on an object). It can also be displayed in a roll-over balloon. DescriptionWindow can display HTML formatted code.
descriptionWindowHeightNumberHeight of description window.
descriptionWindowWidthNumberWidth of description window.
descriptionWindowXNumberX position of description window. In case it is not set, window will be placed near the mouse pointer.
descriptionWindowYNumberX position of description window. In case it is not set, window will be placed near the mouse pointer.
fixedSizeBooleantrueSpecifies if the object should change the size together with the map or keep fixed size. This applies for objects with lat and long properties set, as they move together with the map.
groupIdStringId of a group. You can group MapObjects to groups. Grouped objects will change color together with this object when you roll-over it or click it. You can show/hide them using showGroup(groupId) and hideGroup(groupId) methods of AmMap class. You can also use map.zoomToGroup(groupId) methot to zoom-in the map so that all grouped objects are visible.
heightNumberHeight of an image. Works with predefined images (if type is set) and loaded images (imageURL is set). If svgPath is set, use scale property to change it's size.
idStringUnique id of the object. In case it's area, id should match svg path id from SVG file.
Id can be used with linkToObject property of MapObject - you can link one object to another using it.
imagesArrayArray of MapImage objects.
imageURLStringUrl of an image. Images can be svg, jpg, png or gif files. Note, you can't control color, outlineColor, outlineAlpha and outlineThickness of loaded images. Use svgPath property if you need to change these properties.
labelBackgroundAlphaNumberOpacity of label background alpha.
labelBackgroundColorHex stringColor of label background.
labelColorStringLabel color.
labelFontSizeNumberFont size of a label.
labelPositionStringPosition of the label. Allowed values are: left, right, top, bottom and middle.
labelRollOverColorStringLabel roll-over color.
labelShiftXNumber0In some cases you might want to adjust label position a bit. Use this property to shift label horizontally.
labelShiftYNumber0In some cases you might want to adjust label position a bit. Use this property to shift label vertically.
latitudeNumberLatitude of the image. of the image. Set this property if you want the image to be bounded to the map. Otherwise use left/right/top/bottom properties.
leftNumber/StringDistance from left of a map container to the image. If centered property is false, then the distance is measured to the left of the image, otherwise - to the center. The image will not be bounded to the map if this property is set. Use latitude and longitude properties if you want the image to move with the map. This property can be set as a number (of pixels) or as a percent value, like: image.left = "10%";
linesArrayArray of MapLine objects.
linkToObjectMapObjectlinkToObject can be a reference or id of some other MapObject - MapArea, MapImage or MapLine. It can also be a reference to another DataSet (but not an id). Then user clicks on this object the application would zoom-in to this objects' zoom position (if it is set) and then act as if the linkToObject was clicked. This can also be used for selecting the object you want to be selected right after the map is initialized, as DataSet extends MapObject class, you can specify linkToObject for your DataSet. When you link to another DataSet, you can build drill-down maps.
longitudeNumberLongitude of the image. Set this property if you want the image to be bounded to the map. Otherwise use left/right/top/bottom properties.
mouseEnabledBooleantrueSet this to false to make the object be irresponsive to any interactions like hover or click events.
objectTypeStringRead-only, type of the Object. Possible values are: "DataSet", "MapImage", "MapLine" and "MapArea".
outlineAlphaNumberOpacity of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images.
outlineColorStringColor of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images.
outlineThicknessNumberThickness of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images.
passZoomValuesToTargetBooleanfalseSpecifies if current zoom values should be passed to target MapObject. Useful when building drill down maps.
percentHeightNumberHeight of an image, in percents of map container. Works with predefined images (if type is set) and loaded images (imageURL is set). If svgPath is set, use scale property to change it's size.
percentWidthNumberWidth of an image, in percents of map container. Works with predefined images (if type is set) and loaded images (imageURL is set). If svgPath is set, use scale property to change it's size.
remainVisibleBooleantrueSpecifies if the MapObject and other objects of the same level should remain visible if it was clicked and it has children MapObjects.
NumberDistance from right of a map container to the image. If centered property is false, then the distance is measured to the right of the image, otherwise - to the center. If you set this property, value of left property is ignored. The image will not be bounded to the map if this property is set. This property can be set as a number (of pixels) or as a percent value, like: image.right= "10%"; Use latitude and longitude properties if you want the image to move with the map.
rollOverColorStringRoll over color of of the object.
rollOverScaleNumberScale of the image when hovered. Use value like 1.5 - 2 to enlarge image when user rolls-over it.
scaleNumber1Scale of the image. Works only with images created using svgPath. Use width/height properties for all other images.
selectableBooleanfalseSpecifies if the object can be selected even if it is not clickable. Map object is clickable if zoom properties are set or it has description or has children objects. Sometimes even non of the listed conditions is met you might need it to be clickable. You should set this property to true in this case.
selectedColorStringColor of an object when it is selected (somebody clicked on it).
selectedLabelColorStringColor of a label when image is selected.
selectedScaleNumberScale of the image if it is selected. Use value like 1.5 - 2 to enlarge selected image.
showAsSelectedBooleanfalseSpecifies if selectedColor should be applied to the object. AmMap can have only one selected item at a time, however there might be situations when multiple objects (areas, movies, lines) have to look like they are selected. By setting this property to true, you will be able to produce this result.
showInListBooleanSpecifies if this object must be displayed in ObjectsList Title should be defined in order the object to appear there.
svgPathStringSVG path, for example:

M9,0C4.029,0,0,4.029,0,9s4.029,9,9,9s9-4.029,9-9S13.971,0,9,0z M9,15.93 c-3.83,0-6.93-3.1-6.93-6.93S5.17,2.07,9,2.07s6.93,3.1,6.93,6.93S12.83,15.93,9,15.93 M12.5,9c0,1.933-1.567,3.5-3.5,3.5S5.5,10.933,5.5,9S7.067,5.5,9,5.5 S12.5,7.067,12.5,9z


The line above will create a target icon. For more icons we recommend visiting this page: http://raphaeljs.com/icons/
Simply click on an icon you like and you will get SVG path in the bottom. This is the recommended way to create icons/images in AmMap.
titleStringTitle of a MapObject. It can be displayed in the roll-over balloon and in the header of description window. All areas in SVG maps distributed with amMap has country names (titles) hard coded in the SVG file.
topNumberDistance from top of a map container to the image. If centered property is false, then the distance is measured to the top bound of the image, otherwise - to the center. The image will not be bounded to the map if this property is set. This property can be set as a number (of pixels) or as a percent value, like: image.top = "10%"; Use latitude and longitude properties if you want the image to move with the map.
typeStringType of a predefined image. Allowed values are: circle, rectangle and bubble.
urlStringUrl of an object. The application will go to this url when you click on the object.
urlTargetString_selfTarget of an URL, if URL is a string, for example: "_blank", "_top".
useTargetsZoomValuesBooleanfalseSpecifies if MapObject's, specified in the url zoom values should be used. Useful when building drill down maps.
widthNumberWidth of an image. Works with predefined images (if type is set) and loaded images (imageURL is set). If svgPath is set, use scale property to change it's size.
widthAndHeightUnitsStringpixelsYou can set miles or kilometers as a unit of width/height of an image. This works only with predefined movies (type is set).
zoomLatitudeNumberSpecifies latitude to which map should be moved when this object is clicked
zoomLevelNumberSpecifies map scale to which map should be rescaled when this object is clicked.
zoomLongitudeNumberSpecifies longitude to which map should be moved when this object is clicked.
zoomXNumberSpecifies x position (in percents of stage width) to which map should be moved when this object is clicked. You can also use zoomLat and zoomLong instead of zoomY and zoomY.
zoomYNumberSpecifies y position (in percents of stage height) to which map should be moved when this object is clicked. You can also use zoomLat and zoomLong instead of zoomY and zoomY.

Methods Hide inherited

MapImage class does not have any methods.

Events Hide inherited

MapImage class does not have any events.