<DIV>Hey Rosairo,</DIV> <DIV> </DIV> <DIV>Thanks for a great answer. In one mail I am now very clear with the functioning of Kamap. But I still need your help so as to learn where to put these code. </DIV> <DIV> </DIV> <DIV>I tried copying the php code in tile.php and created an xml file named points.xml in the directory where my tile.php is present. It didn't work. One thing, where is the function 'add_point_to_layer' defined? I will try once again by cleaning the Kachace. Meanwhile, please let me know if I am doing something wrong.</DIV> <DIV> </DIV> <DIV>Also, I liked the idea of using Javascript but again I am confused that which file should contain this Javascript? Again, is there any .js file within Kamap directory having 'addObjectGeo' function?</DIV> <DIV> </DIV> <DIV>Thanks for sparing time in answering my questions..</DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Puneet<BR><BR><BR><B><I>The Bun <rosario.carbone@ipl.com></I></B>
wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>You mentioned PHP then I assume you want to add points server side. As far as<BR>I know, I am new myself to kaMap, you can do it adding the points in the<BR>mapfile itself but it is not very popular, there are many techniques I'll<BR>tell you what I have done in my prototype, I create dinamically an xml file<BR>that contains the <BR>coordinates of the points I want to add, but you can have a database, a file<BR>or anything else you need as data source, anyway I have done this way with<BR>my xml ( the bolded part is the part you actually really need ):<BR><BR>tile.php:<BR><BR>// Create a DOM object<BR>$doc = new DOMDocument();<BR>// Load the xml file<BR>$doc->load("points.xml");<BR>// Get the first "point" element<BR>$points = $doc->getElementsByTagName("point");<BR>// Parse all the "point" elements<BR>foreach( $points as $point )<BR>{<BR>// Get the
coordinates from the "point" element<BR>$longitudes = $point->getElementsByTagName( "longitude" );<BR>$longitude = $longitudes->item(0)->nodeValue;<BR>$latitudes = $point->getElementsByTagName( "latitude" );<BR>$latitude = $latitudes->item(0)->nodeValue;<BR>// Get the layer from the map<BR>$layer = $oMap->getLayerByName("selpoint");<BR>// Add the point to the map<BR>add_point_to_layer($layer, $longitude, $latitude); }<BR><BR>Just for your information my where "points.xml" is structured this way:<BR><BR><?xml version="1.0" encoding="iso-8859-1"?><BR><POINTS><BR><POINT><BR><LONGITUDE>-476249.61</LONGITUDE> <BR><LATITUDE>1543401.94</LATITUDE> <BR></POINT><BR><POINT><BR><LONGITUDE>-474133.08</LONGITUDE> <BR><LATITUDE>922866.17</LATITUDE> <BR></POINT><BR></POINTS><BR><BR>I was nearly forgotting, I needed the layer "selpoint" predefined in<BR>mapfile:<BR><BR>LAYER <BR>NAME selpoint<BR>TYPE POINT<BR>STATUS ON<BR>CLASS<BR>NAME "selpoint"<BR>SYMBOL 2<BR>COLOR
255 0 0 <BR>LABEL<BR>TYPE bitmap<BR>END<BR>STYLE<BR>SYMBOL 2<BR>SIZE 20<BR>COLOR 255 0 0 <BR>END<BR>END<BR>TOLERANCE 5<BR>END <BR><BR>I couldn't find a complete dynamic working example anywhere, in fact I<BR>wanted to create a layer in the code, in memory, and use that dynamic layer<BR>for adding my points all in the in the PHP code but I failed.<BR><BR>Anyway I think much more interesting in my opinion is adding points client<BR>side, this is all in JavaScript. This I used in my prototype, it is hard<BR>coded but it is just as example:<BR><BR>// Prepare the array of images <BR>var imgArray = new Array();<BR>imgArray[0] = document.createElement( 'img' );<BR>imgArray[0].src = 'images/kamap.gif';<BR>imgArray[1] = document.createElement( 'img' );<BR>imgArray[1].src = 'images/kamap.gif';<BR>// Add the first object <BR>var lon = -476249.61;<BR>var lat = 1543401.94; <BR>myKaMap.addObjectGeo( myKaMap.createDrawingCanvas( 500 ), lon, lat,<BR>imgArray[0]);<BR>// Add the second
object<BR>lon = -474133.08;<BR>lat = 922866.17; <BR>myKaMap.addObjectGeo( myKaMap.createDrawingCanvas( 500 ), lon, lat,<BR>imgArray[1]);<BR><BR>Regards<BR>Rosario Carbone<BR><BR><BR>pjqcf wrote:<BR>> <BR>> All,<BR>> <BR>> I have just installed Kamap on my machine and was able to get customized<BR>> shapefile loaded on it. Now the next obvious thing is to plot a point on<BR>> the top of my map that is showing from the map file.<BR>> <BR>> My understanding is: This is done using PHP coding. But I don't have any<BR>> starting point.<BR>> <BR>> It would be really helpful if someone could help me understand how to do<BR>> this?<BR>> <BR>> Thanks in advance..<BR>> <BR>> Puneet<BR>> <BR>> __________________________________________________<BR>> Do You Yahoo!?<BR>> Tired of spam? Yahoo! Mail has the best spam protection around <BR>> http://mail.yahoo.com <BR>> _______________________________________________<BR>>
ka-Map-users mailing list<BR>> ka-Map-users@lists.maptools.org<BR>> http://lists.maptools.org/mailman/listinfo/ka-map-users<BR>> <BR>> <BR><BR>-- <BR>View this message in context: http://www.nabble.com/Novice-on-KaMap---how-to-plot-a-point-on-Kamap--tf4789050.html#a13702689<BR>Sent from the ka-map-users mailing list archive at Nabble.com.<BR><BR>_______________________________________________<BR>ka-Map-users mailing list<BR>ka-Map-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/ka-map-users<BR></BLOCKQUOTE><BR><p> __________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com