|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--AWImgMarkerStyle
This style renders a marker as an image on the map.
Using this style, an application can define an image source, a mouse over event, callback functions
for a mouse click event, and a move over or out of the marker.
function onMarkerClick( event )
{
var s = "lat=" + AWUtils(event.lat) + "\n";
s += "lon=" + AWUtils(event.lon) + "\n";
s += "pixelX=" + event.pixelX + "\n";
s += "pixelY=" + event.pixelY + "\n";
s += "id=" + event.data.id + "\n";
s += "url=" + event.data.url + "\n";
alert(s);
}
function onMarkerOver( event )
{
var s = "lat=" + AWUtils.deg2DMS(event.lat) + "\n";
s += "lon=" + AWUtils.deg2DMS(event.lon) + "\n";
alert(s);
}
function onMarkerOut( event )
{
var s = "lat=" + AWUtils.deg2DMS(event.lat) + "\n";
s += "lon=" + AWUtils.deg2DMS(event.lon) + "\n";
alert(s);
}
// Locate ArcWeb Explorer component.
var myExplorer = new AWMap('map');
// Create an image marker style.
var markerStyle = new AWImgMarkerStyle();
// Used by markers that want to use this marker style.
markerStyle.id = "myMarkerStyleId";
markerStyle.source = "images/id-g.png";
markerStyle.mouseOverSource = "images/id-r.png";
markerStyle.mouseClick = "onMarkerClick";
markerStyle.mouseOver = "onMarkerOver";
markerStyle.mouseOut = "onMarkerOut";
// Register the style with the map.
myExplorer.addMarkerStyle(markerStyle);
// Create a marker.
var marker = new AWMarker();
marker.latlon = latlon;
// Used by markers that want to use this marker style.
marker.markerStyleId = markerStyle.myMarkerStyleId;
// Marker has user defined data in key value pair format. Here, for example, label has the value "ESRI". It could be any string.
marker.data = {label:"ESRI",url:"http://www.esri.com"};
// Put the marker on the map.
myExplorer.addMarker(marker);
| Field Summary | |
Number |
alpha
The transparency of the marker, where 0 indicates full transparency, 100 full opacity. |
Number |
anchorX
The horizontal anchor location in pixels within the image. |
Number |
anchorY
The vertical anchor location in pixels within the image. |
Number |
bubbleHeight
The vertical distance in pixels that a marker should have to display a bubble. |
Number |
bubbleWidth
The horizontal distance in pixels that a marker should have to display a bubble. |
Number |
height
The height in pixels of the source image. |
String |
id
The style identifier used by markers. |
String |
mouseClick
The name of the callback function to execute when a mouse click event occurs. |
String |
mouseOut
The name of the callback function to execute when a mouse out event occurs. |
String |
mouseOver
The name of the callback function to execute when a mouse over event occurs. |
String |
mouseOverSource
The mouse over image source. |
String |
source
The image source. |
Number |
width
The width in pixels of the source and mouse over source image. |
| Constructor Summary | |
AWImgMarkerStyle
()
Construct a new AWImgMarkerStyle object. |
|
| Field Detail |
Number alpha
Number anchorX
Number anchorY
Number bubbleHeight
Number bubbleWidth
Number height
String id
String mouseClick
String mouseOut
String mouseOver
String mouseOverSource
String source
Number width
| Constructor Detail |
AWImgMarkerStyle()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||