function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DLuczakDLuczak 

Adding Fields to display in Map Nearby Accounts 1.1

Hello all

 

I downloaded the Map Nearby Accounts add-on.
This works-- But I would like to add the Account Phone number to the pin information on the map. When I click on the pin the phone number comes up undefined. Can you help me display the phone number of the account on this S Control
Below is the change I did to the S Control

 

var phone= "{!Account.Phone}"; 

 

marker.openInfoWindowHtml(street+" " +city +" " + zip +" "+phone);

 

function addMarker(street, city, zip,type,name,phone){


marker.openInfoWindowHtml("<b>"+name+"</b><br/>"+street+"<br/>"+city+", "+zip+"<br/>"+phone);

 

Below is the total S Control with the changes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/10.0/connection.js"></script>

<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAn-_wL1b8pbIpJfusL0LMmRTwZth5GdZI-P7ekoe_gyhfzl1yZhQIi8Cp4aV-qJ1UGOrfYuaqMQ64Dw";
type="text/javascript">
/*
KEY FOR na1 = ABQIAAAAn-_wL1b8pbIpJfusL0LMmRST0mNpJvtWvmgvEdrgGXs5szHHahSo3uqSA0deOy4G0kJtpNVXvjCUJQ
KEY FOR na2= ABQIAAAAn-_wL1b8pbIpJfusL0LMmRQ72da4xWLg1N8Ce02Xdu0VxpZsuRQ204RfeXqfJttrBEVklwfOQn2xNA
KEY FOR na3= ABQIAAAAn-_wL1b8pbIpJfusL0LMmRQzGTwzk7K_jsQk84g_OzUaojTBGhSetwHN8w7iaZgkWincYpb3inlM5w
KEY FOR na4=ABQIAAAAn-_wL1b8pbIpJfusL0LMmRTKmyQDnYooAkiOINMA2L3CdHnjwRTDGIUZZctCpWuTgsmBTVfM2m-zGw
KEY FOR na5= ABQIAAAAn-_wL1b8pbIpJfusL0LMmRTwZth5GdZI-P7ekoe_gyhfzl1yZhQIi8Cp4aV-qJ1UGOrfYuaqMQ64Dw
KEY FOR na6= ABQIAAAAn-_wL1b8pbIpJfusL0LMmRQwNgRt8BDbI5KFRawO0dUAA_H1zxT4GgBIrvvw23OpfYYkx0d11SMXPw
*/
</script>

</head>

<body onunload="GUnload()" onload="window.resizeTo(450,700)" >

<div id="map" style="width: 400px; height: 300px"></div>
<script type="text/javascript">
//<![CDATA[
document.bgColor = '#f3f3ec';
var map = new GMap(document.getElementById("map"));
//map.disableDragging();
map.enableScrollWheelZoom();
map.enableContinuousZoom();
map.getContainer().style.overflow="hidden";

map.addControl(new GSmallZoomControl());
map.addControl(new GMapTypeControl());

var geo = new GClientGeocoder();

var street= "{!Account.BillingStreet} ";
var city = "{!Account.BillingCity}";
var zip= "{!Account.BillingPostalCode}";
var phone= "{!Account.Phone}";
geo.getLatLng(
street+" "+city,
function(point) {
if (!point) {
alert(street+" "+city + " " +zip+ " not found");
} else {
map.setCenter(point,13);
var marker = new GMarker(point);
map.addOverlay(marker);

GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(street+" " +city +" " + zip +" "+phone);
});

}
}
);



function wheelevent(e)
{

if (!e){
e = window.event
}
if (e.preventDefault){
e.preventDefault()
}
e.returnValue = false;
}

GEvent.addDomListener(map.getContainer(), "DOMMouseScroll", wheelevent);
map.getContainer().onmousewheel = wheelevent;

function clearMarkers(){
map.clearOverlays();
}

function addMarker(street, city, zip,type,name,phone){
var geoTwo = new GClientGeocoder();
geoTwo.getLatLng(street+" "+city,
function(point) {
if (!point) {
alert(street+" "+city + " " +zip+ " not found");
}
else {
map.setCenter(point,13);
var marker = new GMarker(point);
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<b>"+name+"</b><br/>"+street+"<br/>"+city+", "+zip+"<br/>"+phone);
});
}
});
}
//]]>



</script>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlexSalesforce" width="100%" height="90%"
codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">;
<param name="movie" value="{!Scontrol.JavaArchive}" />
<param name="quality" value="high" /><param name="play" value="true" />
<param name="bgcolor" value="#f3f3ec" /><param name="allowScriptAccess" value="always"/>
<param name="wmode" value="transparent" />
<param name="flashvars" value="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_90}&BillingCode={!Account.BillingPostalCode}" />

<embed src="{!Scontrol.JavaArchive}" play="true" bgcolor="#f3f3ec" width="100%" height="700"
name="FlexSalesforce" align="middle"
flashvars="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_90}&BillingCode={!Account.BillingPostalCode}"
loop="false" allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">;
</embed>
</object>
</div>
</body>
</html>

 

 

Thanks

 

Dan Luczak

manroland

DB12345DB12345

Seems like the syntax for phone is incomplete:

 

marker.openInfoWindowHtml("<b>"+name+"</b><br/>"+street+"<br/>"+city+", "+zip+"<br/>"+phone);

DLuczakDLuczak

I compared your string with whats already typed and it is the same

 

 

Your suggestion was
marker.openInfoWindowHtml("<b>"+name+"</b><br/>"+street+"<br/>"+city+", "+zip+"<br/>"+phone);

 

This is what was already typed.  I do not see a difference

marker.openInfoWindowHtml("<b>"+name+"</b><br/>"+street+"<br/>"+city+", "+zip+"<br/>"+phone);

 

I received the undefined statement when I press the push pin on the google map

I get the following when I depress the push pin

ABC Company 
555 Testing. SUITE A
ADDISON, 60096
undefined       (I want the phone number to be displayed)
thanks