I have the following function and need help on using it.
What I want to do:
1: users enter values into textboxes
2: values are converted (with function)
3. Need to enter values into database.
//Get the easting, northing, id and UTM zone from the form
x = document.pointType.easting.value;
y = document.pointType.northing.value;
id = document.pointType.Bed_ID.value;
// Convert MCS to lat/lon
var latLonPt = map.mcsToLonLat(x, y);
window.location="add_GPS_Point.cfm?PT_LAT=" + latLonPt.getY() + "&PT_LON=" +
latLonPt.getX() + "&UTM_EASTING=" + x + "&UTM_NORTHING=" + y + "&UTM_ZONE="
+ zone + "&ID=" + id;
Can someone please help me ? What do I need to do - what should the rest of my code look like. I have set up a form, included the above function - but haven't had any success.
Thanks for your time,
It looks like this function uses code from an object that is define elsewhere (the map object). Did you take this code from a website or a book or...? If so you need to either get the rest of the code or figure out what the
function does and replace it with one of your own.
As regards the rest, it looks like it is expecting there to be a form with name 'pointType' containing three text fields called 'easting', 'northing' and 'Bed_ID' (I think there should be a fourth called zone as well judging by later code) that are used as the input to create the latitude and longitude.
Dai - is this what you were looking for?
function onDigitizedPoint(map, point)
var xyPt = map.lonLatToMcs(point.getX(), point.getY());
var resource = (parent.Eelgrasstop.document.Add.Feature_Type.value);
var loc = "Add_Point.cfm?LAT=" + point.getY() + "&LON=" + point.getX() + "&EAST=" + xyPt.getX() + "&NORTH=" + xyPt.getY() + "&RESOURCE=" + resource;
win = window.open(loc,"AddPoint","status=no,resizable=yes,scrollbars=yes,width=750,height=280");
alert("No available at this time.");
How does this code work with the function?
Dai - or is this the code I need to accomplish my task?
<object ID="map" WIDTH="101%" HEIGHT="100%"
CODEBASE="http://www.shim.bc.ca/viewer/v6/mgaxctrl.cab#Version=6,0,2,2"> <param name="URL"
<param name="Lat" value="">
<param name="Lon" value="">
<param name="MapScale" value="0">
<param name="MapWidth" value="">
<param name="Units" value="km">
<param name="ToolBar" value="On">
<param name="StatusBar" value="On">
<param name="LayersViewWidth" value="200">
<param name="ObjectLinkTarget" value="Eelgrassrpt">
BORDER="0" WIDTH="101%" HEIGHT="100%" NAME="map" TYPE="application/x-mwf">
The last one looks like the winner, though I could not tell you what it does, so it will probably be a bit hit and miss coding for it unless you can contact the provider of this object for documentation?
Thanks for getting back to me Dai,
I have made some progress - I can convert the input values using the function successfully now.
Now I need to figure out how to pass the values that have been converted to a new page.
I will put this question in a new post.
I appreciate you taking the time to answer my posts.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)