[ka-Map-users] Plotting data points (buildings)
Paul Spencer
pspencer at dmsolutions.ca
Sat Aug 13 10:34:45 EDT 2005
Ric,
you can do something like the following in javascript:
var poiCanvas = null;
var aPOIs = []; //array of points of interest that you populate
//assume each entry is an array of name/lon/lat
function plotPOIs()
{
if (!poiCanvas)
{
poiCanvas = myKaMap.createDrawingCanvas( 1000 );
}
for( var i in aPOIs)
{
var img = document.createElement('img');
img.src = 'images/poi.png'; //your image
img.width = 18; //adjust accordingly
img.height = 18;
img.alt = aPOIs[i][0];
img.title = aPOIs[i][0];
img.poiIndex = i; //can be used later in an onclick
img.onclick = myPOI_onclick;
img.cursor = 'help'; //change cursor
myKaMap.addObjectGeo( poiCanvas, aPOIs[1], aPOIs[2], img );
}
}
function myPOI_onclick()
{
var poi = aPOIs[this.poiIndex];
alert( 'selected poi ' + poi[0] );
}
Cheers
Paul
Ric Chura wrote:
> I am still in the process of installing ka-Map on my Solaris box, but am
> curious if it is possible to plot points of interest on the map. For
> instance, I have a list of buildings with latitude and longitude
> coordinates, would it be possible to easily plot these?
>
> Thanks for any insight,
>
> -Ric
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
--
+-----------------------------------------------------------------+
|Paul Spencer pspencer at dmsolutions.ca |
+-----------------------------------------------------------------+
|Applications & Software Development |
|DM Solutions Group Inc http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+
More information about the ka-Map-users
mailing list