Polylines Polygonsthen posting to SQL through form
2nd time to try and post this google is not happy today:
I have a need to take a polygon that I drew and place it into a memo
field and then post that to a database or send via email with the
polypoints. I found this code that kinda works. but how do I take the
poly's and place into a memo field instead of to the DIV panel: any
suggestions:
http://lecturer.eng.chula.ac.th/fsvskk/gglmap/swatmap5.html
this guy was on right track with what I wanted but his code is so
confusing my eyes hurt there should be something alot easier.
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
<script
src="http://maps.google.com/maps?file=api&v=1&key=ABQIAAAASVW2GF-IsyBOWfclEExqpRR950Ozj4oDb8QWS3jNQ4ec9TnYZBSS8e1-vm14qfJ1HjSeZlqnvy3BBQ"
type="text/javascript"></script>
</head>
<body>
<div style="width: 25%; float: left;"><form method="POST"
action="hca_test.asp">
<h3>Last Points</h3>
<ul id="panel"></ul>
<a href="#" onclick="clearMap(); return false;">Clear Map</a> | <a
href="#" onclick="newLine(); return false;">New Line</a>
<input type=submit name=submit value=submit></form></div>
<div style="width: 75%; float: right;">
<div id="map" style="width: 100%px; height: 600px;"></div>
</div>
<script type="text/javascript">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(-97.68184661865234,
37.62238973852369), 8);
var lastPoint = 0
polyPoints = new Array ( );
polyGPoints = new Array ( );
var panel = document.getElementById( 'panel' );
function clearMap() {
map.clearOverlays()
panel.innerHTML = ""
newLine()
}
function newLine() {
panel.innerHTML = ""
lastPoint = 0
}
GEvent.addListener(map, 'click', function(overlay, point) {
thisPoint = point.toString()
thisPoint = thisPoint.substr(1,(thisPoint.length - 2))
tempPts = thisPoint.split(',')
var polyLongPoint = tempPts[0] * 1
var polyLatPoint = tempPts[1] * 1
polyPoints[lastPoint] = new GPoint(polyLongPoint,polyLatPoint)
if (lastPoint > 0) {
map.addOverlay(new
GPolyline([polyPoints[lastPoint],polyPoints[lastPoint-1]], "#CC0000",
5));
}
panel.innerHTML = '<li>' + polyPoints[lastPoint] + '</li>' +
panel.innerHTML;
lastPoint++
})
//]]>
</script>
0 Comments:
Yorum Gönder
<< Home