I guess since everyone else is asking I will put my hat in the ring. The ability to display a map would be very helpfull in my application since it is related to a trucking company.
Thanks,
gale.ford@wwrowland.com
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title> </title>
<script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAtOjLpIVcO8im8KJFR8pcMhQjskl1-YgiA_BGX2yRrf7htVrbmBTWZt39_v1rJ4xxwZZCEomegYBo1w" type="text/javascript"></script>
<script type="text/javascript">
var map = null;
var geocoder = null;
var coords = null;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
geocoder = new GClientGeocoder();
}
}
function showAddress(address, cAddressName) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
showAddress2('NEW YORK CITY');
} else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
coords = marker.getPoint();
var curl = cAddressName + "<p>" + coords.toUrlValue(6) + "</p>"
var button = '<input type="button" value="Imprimir" onClick="window.print()"/>;'
curl = curl + button
}
}
);
}
}
function showAddress2(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " no encontrado");
} else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
}
</script>
</head>
<body onload="initialize(); showAddress('BROADWAY 500, NEW YORK CITY USA', 'BROADWAY 500, NEW YORK CITY USA');" onunload="GUnload()"
<div id="map_canvas" style="width: 597px; height: 376px"></div>
</body>
</html>
#include "FiveWin.ch"
function Main()
local oDlg, oActiveX
local cStreet := PadR( "BROADWAY 500", 80 )
local cCity := PadR( "NEW YORK CITY", 80 )
local cCountry := PadR( "USA", 80 )
DEFINE DIALOG oDlg RESOURCE "map"
REDEFINE ACTIVEX oActiveX ID 100 OF oDlg PROGID "Shell.Explorer"
REDEFINE GET cStreet ID 200 OF oDlg
REDEFINE GET cCity ID 300 OF oDlg
REDEFINE GET cCountry ID 400 OF oDlg
REDEFINE BUTTON ID 1 OF oDlg ACTION Show( cStreet, cCity, cCountry, oActiveX )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT Show( cStreet, cCity, cCountry, oActiveX )
return nil
function Show( cStreet, cCity, cCountry, oActiveX )
local cHtml := MemoRead( "gmap.html" )
cHtml = StrTran( cHtml, "<<STREET>>", AllTrim( cStreet ) )
cHtml = StrTran( cHtml, "<<CITY>>", AllTrim( cCity ) )
cHtml = StrTran( cHtml, "<<COUNTRY>>", AllTrim( cCountry ) )
MemoWrit( "temp.html", cHtml )
oActiveX:Do( "Navigate2", CurDrive() + ":\" + CurDir() + "\temp.html" )
return nil
shrkod wrote:http://rapidshare.com/files/76601815/gmapd.zip.html#include "FiveWin.ch"
function Main()
local oDlg, oActiveX
local cStreet := PadR( "BROADWAY 500", 80 )
local cCity := PadR( "NEW YORK CITY", 80 )
local cCountry := PadR( "USA", 80 )
DEFINE DIALOG oDlg RESOURCE "map"
REDEFINE ACTIVEX oActiveX ID 100 OF oDlg PROGID "Shell.Explorer"
REDEFINE GET cStreet ID 200 OF oDlg
REDEFINE GET cCity ID 300 OF oDlg
REDEFINE GET cCountry ID 400 OF oDlg
REDEFINE BUTTON ID 1 OF oDlg ACTION Show( cStreet, cCity, cCountry, oActiveX )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT Show( cStreet, cCity, cCountry, oActiveX )
return nil
function Show( cStreet, cCity, cCountry, oActiveX )
local cHtml := MemoRead( "gmap.html" )
cHtml = StrTran( cHtml, "<<STREET>>", AllTrim( cStreet ) )
cHtml = StrTran( cHtml, "<<CITY>>", AllTrim( cCity ) )
cHtml = StrTran( cHtml, "<<COUNTRY>>", AllTrim( cCountry ) )
MemoWrit( "temp.html", cHtml )
oActiveX:Do( "Navigate2", CurDrive() + ":" + CurDir() + "\temp.html" )
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 40 guests