Usuário com melhor resposta
CRM com Live Maps ou Google Maps

Pergunta
-
Respostas
-
Oi Luiz,
Segue o exemplo sem passar latitude e longitude:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/jscript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5" mce_src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
<script type="text/jscript">
var map = null;
var latitude = null;
var longitude = null;
var address = "";
function GetMap()
{
//Get adress from CRMvar addressLine1 = parent.document.forms[0].all.address1_line1.DataValue;
var postalCode = parent.document.forms[0].all.address1_postalcode.DataValue;
var city = parent.document.forms[0].all.address1_city.DataValue;
var stateOrProvince = parent.document.forms[0].all.address1_stateorprovince.DataValue;
var country = parent.document.forms[0].all.address1_country.DataValue;
//Compose customer address
address = addressLine1+", "+postalCode+" "+city+" ("+stateOrProvince+"), "+country;
map = new VEMap('myMap');
map.LoadMap();
if (latitude != null && longitude != null)
{
PlacePushPin(latitude,longitude);
}
else
{
map.Find(null,address,null,null,0,10,true,true,true,true,FindCallBack);
}
}
function FindCallBack(shapeLayer, results, positions, moreResults, e)
{
if(positions != null && positions.length > 0)
{
PlacePushPin(positions[0].LatLong.Latitude,positions[0].LatLong.Longitude);
latitude = positions[0].LatLong.Latitude;
longitude = positions[0].LatLong.Longitude;
parent.document.forms[0].all.address1_latitude.DataValue = latitude;
parent.document.forms[0].all.address1_longitude.DataValue = longitude;
}
}
function PlacePushPin(lat, lon)
{
latlong = new VELatLong(lat,lon);
customerPushPin = new VEShape(VEShapeType.Pushpin,latlong);
map.AddShape(customerPushPin);
map.SetCenterAndZoom(latlong,15);
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:1000px; height:425px;"></div>
</body>
</html>
[]´s
Carlos Amorim Junior
"Trabalhe com amor, divida seu conhecimento com a comunidade."
Treinamentos, vídeos e artigos sobre CRM ? - http://www.dynamicscrm.com.br- Sugerido como Resposta Carlos Amorim Junior segunda-feira, 1 de junho de 2009 13:57
- Marcado como Resposta Carlos Amorim Junior sábado, 9 de janeiro de 2010 10:00
Todas as Respostas
-
Oi Luiz,
Segue o exemplo sem passar latitude e longitude:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/jscript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5" mce_src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>
<script type="text/jscript">
var map = null;
var latitude = null;
var longitude = null;
var address = "";
function GetMap()
{
//Get adress from CRMvar addressLine1 = parent.document.forms[0].all.address1_line1.DataValue;
var postalCode = parent.document.forms[0].all.address1_postalcode.DataValue;
var city = parent.document.forms[0].all.address1_city.DataValue;
var stateOrProvince = parent.document.forms[0].all.address1_stateorprovince.DataValue;
var country = parent.document.forms[0].all.address1_country.DataValue;
//Compose customer address
address = addressLine1+", "+postalCode+" "+city+" ("+stateOrProvince+"), "+country;
map = new VEMap('myMap');
map.LoadMap();
if (latitude != null && longitude != null)
{
PlacePushPin(latitude,longitude);
}
else
{
map.Find(null,address,null,null,0,10,true,true,true,true,FindCallBack);
}
}
function FindCallBack(shapeLayer, results, positions, moreResults, e)
{
if(positions != null && positions.length > 0)
{
PlacePushPin(positions[0].LatLong.Latitude,positions[0].LatLong.Longitude);
latitude = positions[0].LatLong.Latitude;
longitude = positions[0].LatLong.Longitude;
parent.document.forms[0].all.address1_latitude.DataValue = latitude;
parent.document.forms[0].all.address1_longitude.DataValue = longitude;
}
}
function PlacePushPin(lat, lon)
{
latlong = new VELatLong(lat,lon);
customerPushPin = new VEShape(VEShapeType.Pushpin,latlong);
map.AddShape(customerPushPin);
map.SetCenterAndZoom(latlong,15);
}
</script>
</head>
<body onload="GetMap();">
<div id='myMap' style="position:relative; width:1000px; height:425px;"></div>
</body>
</html>
[]´s
Carlos Amorim Junior
"Trabalhe com amor, divida seu conhecimento com a comunidade."
Treinamentos, vídeos e artigos sobre CRM ? - http://www.dynamicscrm.com.br- Sugerido como Resposta Carlos Amorim Junior segunda-feira, 1 de junho de 2009 13:57
- Marcado como Resposta Carlos Amorim Junior sábado, 9 de janeiro de 2010 10:00
-
Oi Luiz,
Conseguiu utilizar o HTML ?
[]´s
Carlos Amorim Junior
"Trabalhe com amor, divida seu conhecimento com a comunidade."
Treinamentos, vídeos e artigos sobre CRM ? - http://www.dynamicscrm.com.br -
Olá Carlos, muito bom seu artigo de integracao do Google no CRM.
Fiz e já esta funcionando.
Um detalhe me faltou: como apliquei o COMBO CRM, a cidade é um campo do tipo lookup.. como faço o código HTML buscar o valor TXT do campo combocrm_Cidade ?
[]'s
Bonfim.
Bonfim