i need to implement google map to implement my customer table which has country field.the selected country should be generated and rounded in map.please any one help me to solve out a problemThis message has been edited. Last edited by: <Emily McAllister>,
Webfocus AppStudio 8201 Windows
May 19, 2016, 12:46 PM
Mike Williams
Hi Durai,
Not exactly a specific answer to your question, but this conversation string involves using google visualizations and might assist:
Thank you for your reply mike williams.I tried it but showing javascript errors
Webfocus AppStudio 8201 Windows
June 06, 2016, 09:22 AM
GavinL
Google maps is pretty easy to add as it's all JavaScript, but you must do it at a code level.
Run your standard query to get your address into a WF Variable like below, &PrimaryPropAddr, &PrimaryPropAddrCity, &PrimaryPropAddrState, and &PrimaryPropAddrZip
TABLE FILE YOURFOLDER/PROPERTYINFO
PRINT
COMPUTE PrimaryPropAddr/A1000V = PROPERTYINFO_GET.RESPONSE.PROPERTYSTREETNUMBER || ' ' | PROPERTYINFO_GET.RESPONSE.PROPERTYSTREETNAME || ' ' | PROPERTYINFO_GET.RESPONSE.PROPERTYSTREETDIRECTION || '';
COMPUTE PrimaryPropAddrCity/A1000V = PROPERTYINFO_GET.RESPONSE.CITYNAME || '';
COMPUTE PrimaryPropAddrState/A1000V = PROPERTYINFO_GET.RESPONSE.PROPERTYALPHASTATECODE || '';
COMPUTE PrimaryPropAddrZip/A1000V = PROPERTYINFO_GET.RESPONSE.PROPERTYZIPCODE || '-' | PROPERTYINFO_GET.RESPONSE.PROPERTYZIPSUFFIX || '';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE HOLD AS HOLDPROPERTY FORMAT INTERNAL
END
-RUN
-READFILE HOLDPROPERTY
-RUN
-SET &PrimaryPropAddr = TRUNCATE(&PrimaryPropAddr);
-SET &PrimaryPropAddrCity = TRUNCATE(&PrimaryPropAddrCity);
-SET &PrimaryPropAddrState = TRUNCATE(&PrimaryPropAddrState);
-SET &PrimaryPropAddrZip = TRUNCATE(&PrimaryPropAddrZip);
-HTMLFORM BEGIN
<html>
<head>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
var map;
var tmpzip = "&PrimaryPropAddrZip.EVAL".trim().substr(0,5);
var address = "&PrimaryPropAddr.EVAL, &PrimaryPropAddrCity.EVAL, &PrimaryPropAddrState.EVAL ".concat(" ", tmpzip);
function googleInit() {
if(address.length<=5)
return;
geocoder = new google.maps.Geocoder();
var myOptions = {
zoom: 17,
zoomControl: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.DEFAULT,
position: google.maps.ControlPosition.LEFT_CENTER
},
rotateControl: false,
mapTypeControl: false,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
streetViewControl: true,
streetViewControlOptions: {
position: google.maps.ControlPosition.LEFT_CENTER
},
mapTypeId: google.maps.MapTypeId.HYBRID
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
if (geocoder) {
geocoder.geocode({
'address': address
}, function(results, status) {
if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {
alert("We could not find " + address);
} else if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var infowindow = new google.maps.InfoWindow({
content: '<i>&Borrower.EVAL</i><hr/><b>' + address + '</b>',
size: new google.maps.Size(150, 50)
});
var marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map,
title: address
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
loadLatLng(address);
}
});
}
}
</script>
<style>
.map_canvas {
width: 500px;
height: 500px;
}
</style>
</head>
<body onload="googleInit()">
<div id="map_canvas" class="map_canvas"></div>
</body>
</html>
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server