Hi Gary,
To implement your requirement using option 2, you need to use the OpenLayers library to add markers at first. You could specify the icon and position information for each marker; also you could use popup as the tooltip of each marker. The client side code is like this:
var markers = new OpenLayers.Layer.Markers("Markers");
var size = new OpenLayers.Size(32, 32);
var offset = new OpenLayers.Pixel(-(size.w / 2), -size.h);
var icon = new OpenLayers.Icon('../../theme/images/' + LonLat[2], size, offset);
var marker = new OpenLayers.Marker(new OpenLayers.LonLat(lon, lat), icon);
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(LonLat[0], LonLat[1]), icon));
AddPopup(marker, 'siteId', LonLat[1], LonLat[0], "siteDesc", message.innerText);
Map1.GetOpenLayersMap().addLayer(markers);
And then you could use a callback to update each marker in the timer tick event:
Add a callback handler in the server side:
//Add Callback handler
ClientScriptManager csm = Page.ClientScript;
String reference = csm.GetCallbackEventReference(this, "args", "Success", "context", "Error", false);
String callbackScript = "function CallServerMethod(args, context) {\n" + reference + ";\n }";
csm.RegisterClientScriptBlock(this.GetType(), "CallServerMethod", callbackScript, true);
Then in the client side update each marker by the return value of the call back:
function Success(args, context) {
context.innerText = args;
LonLat = args.toString().split(",");
var size = new OpenLayers.Size(32, 32);
var offset = new OpenLayers.Pixel(-(size.w / 2), -size.h);
var icon = new OpenLayers.Icon('../../theme/images/' + LonLat[2], size, offset);
var marker = new OpenLayers.Marker(new OpenLayers.LonLat(LonLat[0], LonLat[1]), icon);
markers.clearMarkers();
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(LonLat[0], LonLat[1]), icon));
AddPopup(marker, 'siteId', LonLat[1], LonLat[0], "siteDesc", message.innerText);
}
Any more questions please let me know.
Thanks,
Sun