Well, As i sad before:<BR>&nbsp;&nbsp; <BR>&nbsp; I am not having problems with theory about projections (I have some <BR>experience in cartography...and I understand what is a projection), I am <BR>having problems with CODING, here I am NEW. I just wanted to see some <BR>examples, but I will find the solution<BR>&nbsp;&nbsp; <BR>&nbsp; Thank you for your time<BR><BR><BR><B><I>Puneet Kishor &lt;punkish@eidesis.org&gt;</I></B> wrote:  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>On Feb 9, 2006, at 7:57 AM, william paul wrote:<BR><BR>&gt; I replay to the email, I didn't thing that the list will not receive <BR>&gt; the email!!!<BR>&gt; &nbsp;<BR>&gt; My problem isn't how you transform from DD to DMS. I already know this.<BR>&gt; &nbsp;<BR>&gt; I want to make the transformation in such manner that the DMS are <BR>&gt; displayed ON MOUSEMOVE over the map, which means that the coordinates <BR>&gt; are changing with position of
 the cursor on the map<BR>&gt; &nbsp;<BR>&gt; I did that for DD using a script found on the list, but I can't make <BR>&gt; it work for DMS<BR>&gt; &nbsp;<BR>&gt; My code looks like:<BR>&gt; &nbsp;<BR>&gt; var x2 = event.offsetX; // mouse coordinates in pixels<BR>&gt; var y2 = event.offsetY; // mouse coordinates in pixels<BR>&gt; var res_dd = ([maxlon] - [minlon]) / [mapwidth]; // resolution in DD<BR>&gt; var x_dd = [minlon];<BR>&gt; var y_dd = [minlat];<BR>&gt; x1_dd = Math.round(((x2*res_dd) + x_dd)*1000000)/1000000; <BR>&gt; //coordinates in DD to be displayed on mousemove<BR>&gt; y1_dd = Math.round(((([mapheight] - y2)*res_dd) + <BR>&gt; y_dd)*1000000)/1000000; //coordinates in DD to be displayed on <BR>&gt; mousemove<BR>&gt;<BR>&gt; window.status="Latitude DD: " + y1_dd + " " + "Longitude DD: " + y1_dd;<BR>&gt; &nbsp;<BR>&gt; I tried for DMS:<BR>&gt; &nbsp;<BR>&gt; //for longitude in DMS<BR>&gt;<BR>&gt; var dd = Math.floor(x1_dd);<BR>&gt; var m = Math.floor((x1_dd - dd) *
 60);<BR>&gt; var s = Math.ceil((((x1_dd - dd) * 60) - m) *60);<BR>&gt; &nbsp;<BR>&gt; I also have tried to break the resolution in DMS, but I don't know how <BR>&gt; to multiply the resolution with the coordinates in pixel and then add <BR>&gt; to minlon<BR><BR><BR>I am not sure what the problem is. Do for DMS exactly the way you are <BR>doing for DD. There is nothing conceptually different between DD and <BR>DMS. They express the same thing in different ways -- it is like saying <BR>1 lb of tomatoes versus 454 gms of tomatoes. Figure out your min, max <BR>in DMS, and add them to your current mouse coordinates.<BR><BR>That said, look at Clint Johnson's email from yesterday. He recommends <BR>reading about projections at <BR>http://fisher.lib.virginia.edu/reference/help/esri/esri_pdfs_9.html, <BR>and that should be the first thing that all MapServer users should read <BR>before setting out making mapping websites. Ed McNierny also has <BR>elaborated on this several times (in fact, I
 have been thinking of <BR>taking all of Ed's emails and compiling them into a "must read"... note <BR>to Ed -- if you save your MapServer-list emails, forward them to me and <BR>I will do the rest).<BR><BR>Remember, that the pixel space is a rectangle, in that, opposite sides <BR>are equal, while Lat/Long space is more like a trapezoid, in that, the <BR>horizontal opposite sides are not equal, and in fact, at the poles, it <BR>becomes a triangle. If you really want to be exact with your coordinate <BR>display, project your map into a rectangular coordinate system and then <BR>you will get what you want.<BR><BR><BR>&gt; &nbsp;<BR>&gt; william paul wrote:<BR>&gt; &gt; Hi:<BR>&gt; &gt;<BR>&gt; &gt; I know this, my problem is other, but...I will solve it<BR>&gt;<BR>&gt; Please send all replies to the list as well. In the meantime, would<BR>&gt; the following help --<BR>&gt;<BR>&gt; //(0) Grab the dd value<BR>&gt; var dd = obj.value;<BR>&gt;<BR>&gt; // (1) The Degrees are simply the
 numbers to the left of the decimal<BR>&gt; // (using 42.36824 as an example, the degrees would be 42)<BR>&gt; var d = Math.floor(dd);<BR>&gt;<BR>&gt; // (2) To determine the Minutes, multiply the number to the right of<BR>&gt; // the decimal point by 60 (example: .36824 x 60 = 22.0944)<BR>&gt; // (3) The Minutes are the numbers to the left of the decimal point<BR>&gt; // (in this example, 22)<BR>&gt; var m = Math.floor((dd - d) * 60);<BR>&gt;<BR>&gt; // (4) To determine the Seconds, multiply the number to the right of<BR>&gt; // the decimal point by 60 (example: .0944 x 60 = 5.664)<BR>&gt; // (5) The Seconds are the numbers to the left of the decimal point,<BR>&gt; // rounded up (in this example, 06)<BR>&gt; var s = Math.ceil((((dd - d) * 60) - m) * 60);<BR>&gt;<BR>&gt; // display it<BR>&gt; var dms = d + ' deg, ' + m + ' min, ' + s + ' sec';<BR>&gt;<BR>&gt; &gt;<BR>&gt; &gt; */Puneet Kishor <PUNKISH@EIDESIS.ORG>/* wrote:<BR>&gt; &gt;<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; william
 paul wrote:<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Hi:<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I display the coordinates on mousemove over the map. The<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; coordinates are<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt; in DD and UTM, but I would like display them also in DMS.<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<BR>&gt; &gt;<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From the very first hit on Google --<BR>&gt; &gt;<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (1) The Degrees are simply the numbers to the left of the decimal<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (using 42.36824 as an example, the degrees would be 42)<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (2) To determine the Minutes, multiply the number to the right <BR>&gt; of<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; the decimal point by 60 (example: .36824 x 60 = 22.0944)<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (3) The Minutes are the
 numbers to the left of the decimal point<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (in this example, 22)<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (4) To determine the Seconds, multiply the number to the right of<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; the decimal point by 60 (example: .0944 x 60 = 5.664)<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; (5) The Seconds are the numbers to the left of the decimal point,<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; rounded up (in this example, 06)<BR>&gt; &gt;<BR>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; Implementing it in Js is left as an exercise for the reader...<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt;<BR>&gt;<BR>&gt; --<BR>&gt; Puneet Kishor<BR>&gt;<BR>&gt; __________________________________________________<BR>&gt; Do You Yahoo!?<BR>&gt; Tired of spam? Yahoo! Mail has the best spam protection around<BR>&gt; http://mail.yahoo.com<BR>--<BR>Puneet Kishor<BR><BR></BLOCKQUOTE><BR><p>
        
                <hr size=1> <a href="http://us.rd.yahoo.com/mail_us/taglines/virusmail/*http://mail.yahoo.com">Yahoo! Mail</a> - Helps protect you from nasty viruses.