mapimage.java public method addition?

Tom Kralidis tomkralidis at hotmail.com
Wed Jan 24 18:40:26 PST 2001


Steve,

Thanks alot for the upgraded code.

FYI, here's what I added to mouseMoved:

public void mouseMoved(MouseEvent e) {
  int x = e.getX();
  int y = e.getY();
  // javascript function
  window.eval("mapOver('" + x + "','" + y + "');");
}

..then, the javascript function mapOver:

function mapOver(x,y) {
  document.mapserv.mapOverX.value = Number([minx] + (x * (Math.abs
([minx]) - Math.abs(([maxx]))) / getMapSize('width')));
  document.mapserv.mapOverY.value = Number([maxy] - (y * (Math.abs([maxy]) - 
Math.abs(([miny]))) / getMapSize('height')));
}

(getMapSize is a js function to split [mapsize] to get the image height and 
width.  Can I get to these through the CGI params without parsing in 
javascript?)

Probably could be *alot* cleaner, but it works, provided there is a mapOver 
function defined in the HTML.

Joan, thanks alot for the Java tip.

..Tom

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




More information about the MapServer-users mailing list