Hi Terry,
Assuming you mean hosting it on a nettalk server, here is how i do it:
1st example: Google Maps -
http://boydell.com.au/displayproperty?c=3295&t=R&o=442nd example: Google Maps + Google Street View -
http://web.agencyone.net.au/displayproperty?c=5397&t=R&o=68Both these sites are in NetTalk. View source to see how the javascript works.
Add this into your page up the top:
<script type="text/javascript">
google.load("maps", "2.x");
function initialize() {
if (google.maps.BrowserIsCompatible()) {
var map = new google.maps.Map2(document.getElementById("map"));
map.addControl(new google.maps.SmallMapControl());
map.addControl(new google.maps.MapTypeControl());
map.enableDoubleClickZoom();
map.enableContinuousZoom();
var point = new google.maps.LatLng(-27.435019,153.055122)
map.setCenter(point, 15);
var marker = new google.maps.Marker(point);
map.addOverlay(marker);
}
}
google.setOnLoadCallback(initialize);
</script>
Put this in your page where you want the map to appear:
<div id="map" style="width: 600px; height: 400px"></div>Your body tag also needs to have this paramater:
<body onunload="GUnload()"> The lat (-27.435019) and long (153.055122) will need to be determined.
I used clarion code and nettalk for this (we geocode all our addresses beforehand and save in our database)
Geocode PROCEDURE (lAddress,lLat,lLong) ! Declare Procedure
DATA
lResult STRING(4096)
lTempStr STRING(255)
_Address STRING(255)
CODE
lLat = 0
lLong = 0
_Address = CLIP(lAddress) & ', AUSTRALIA '
lResult = GetWebResource('http://maps.google.com/maps/geo?output=xml&key=ABQIAAAApp1Rcx2dBQ7pq4dEoAe_gxS-GNOCTuXEuEX_V8KEsLZWwbLQ4BTwBNzqaL7pWVQVMGMDxrqDnrDmNw&q='&CLIP(_Address))
lTempStr= ''
Pos# = INSTRING('<code>',lResult,1,1)
IF Pos# ~= 0
lTempStr = SUB(lResult,Pos#+6,255)
Pos# = INSTRING('</code>',lTempStr,1,1)
IF Pos# ~= 0
lTempStr = SUB(lTempStr,1,Pos#-1)
.
.
lStatusCode# = lTempStr
IF lStatusCode# = 200
Pos# = INSTRING('<coordinates>',lResult,1,1)
IF Pos# ~= 0
lTempStr = SUB(lResult,Pos#+13,255)
Pos# = INSTRING('</coordinates>',lTempStr,1,1)
IF Pos# ~= 0
lTempStr = SUB(lTempStr,1,Pos#-1)
Pos# = INSTRING(',',lTempStr,1,1)
IF Pos# ~= 0
lLong = SUB(lTempStr,1,Pos#-1)
lLat = SUB(lTempStr,Pos#+1,255)
.
.
.
ELSE
!Failed
lLat = 0
lLong = 0
.
GetWebResource is one of my clarion functions using NetTalk to return the webpage in a string. Good for basic webservice stuff. The google response is in XML, most of the result i'm not interested in, so rather that parse to XML properly, i just look for the bits i need.
Lose the 'AUSTRALA' bit, thats to ensure we don't get any crazy geocodes in other countries.
You'll need to register with google maps for an account to get a web service key
key=ABQIAAAApp1Rcx2dBQ7pq4dEoAe_gxS-GNOCTuXEuEX_V8KEsLZWwbLQ4BTwBNzqaL7pWVQVMGMDxrqDnrDmNwThats one of mine and its bound to one of my IP addresses, so you'll need your own.
Regards
Bill Shields