AddImgMarker
(TLayer.AddImgMarker Method)
Adds a image marker on the layer. The marker would be located at the given geographical position (arguments one and two) .The image displayed by the marker is given by the argument three (_url). The last argument specifies the X and Y offsets for the image and the border color and width for the image marker.
public AddImgMarker(latitude, longitude,_url,strStyle):Void
Parameters
latitude : Number - Set the latitude of the geographical position on the layer where the Marker added.
longitude : Number - Set the longtitude of the geographical position on the layer where the Marker added.
_url : String - This _url specify the image location.
strStyle : String - A string that specifies the style of the ImgMarker. It can only have the following attributes: (seperate each attribute with ; except for the last one)
a. X_OFFSET : Number - Set the X offsets in pixel on the screen of the image location on the screen.
b. Y_OFFSET : Number - Set the Y offsets in pixel on the screen of the image location on the screen.
c. BORDER_COLOR : Color Hex Code - Set the border color for the image marker.
d. BORDER_WIDTH : Number - Set the width for the image marker .
Returns
Void
Example
The following example shows how to add an image marker on the layer replacing the TerraFly® API default marker.
<div id="mapContainer" style="width: 640px; height: 400px;"></div>
<script type="text/javascript">
var map0 = new TMap(mapContainer, 25.7590256665386, -80.3738769902151, 15, mapLoaded, 1, true, "", "hybrid");
function mapLoaded() {
var layer0=map0.AddLayer();
var marker1=layer0.AddImgMarker(25.759025666538, -80.3738769902151,
"http://maps.cs.fiu.edu/API_doc_stage/Terrafly_API_Prod/images/star.gif",
"X_OFFSET=0;Y_OFFSET=0;BORDER_COLOR=0xFFFFFF;BORDER_WIDTH=2");
}
</script>
See also
SetMarketStyle()