Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Parse address field into external Bing Maps API

Posted on by Microsoft Employee

Hi, Im using the following api from Bing Maps to add aerialview map into my account entity for address field.

I am not sure as to how I can parse the address1_composite field into the following html code.

<!DOCTYPE html>
<html>
<head>
<title>birdseyeV2HTML</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<body>
<div id='printoutPanel'></div>

<div id='myMap' style='width: 100vw; height: 100vh;'></div>
<script type='text/javascript'>
function loadMapScenario() {
var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
/* No need to set credentials if already passed in URL */
center: new Microsoft.Maps.Location(37.239027, -121.966237),
mapTypeId: Microsoft.Maps.MapTypeId.birdseye });
var pushpin = new Microsoft.Maps.Pushpin(new Microsoft.Maps.Location(37.239027, -121.966237), { title: 'sample text' });
var polyline = new Microsoft.Maps.Polyline([new Microsoft.Maps.Location(37.239279, -121.966286),
new Microsoft.Maps.Location(37.239481, -121.966162),
new Microsoft.Maps.Location(37.239622, -121.966179),
new Microsoft.Maps.Location(37.239881, -121.966654),
new Microsoft.Maps.Location(37.238978, -121.967443),
new Microsoft.Maps.Location(37.238807, -121.967427),
new Microsoft.Maps.Location(37.237538, -121.964750),
new Microsoft.Maps.Location(37.236868, -121.965635),
new Microsoft.Maps.Location(37.236001, -121.965812),
new Microsoft.Maps.Location(37.235905, -121.965091),
new Microsoft.Maps.Location(37.235577, -121.964664)], { strokeColor: 'lightblue', strokeThickness: 5 });
var layer = new Microsoft.Maps.Layer();
layer.add([pushpin, polyline]);
map.layers.insert(layer);

}
</script>
<script type='text/javascript' src='www.bing.com/.../mapcontrol;callback=loadMapScenario' async defer></script>
</body>
</html>

I am a rookie at crm backend. Please help.

Thanks.

*This post is locked for comments

  • Inogic Profile Picture
    Inogic 24,094 on at
    RE: Parse address field into external Bing Maps API

    Hi,

    You need to pass the address field to Bing Maps and Bing Maps will return latitude and longitude as a response. And using the latitude and longitude, you can plot in the bing map.

    You can refer the following two links for details.

     

    1)      http://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk#searchByAddress+JS

    2)      https://blogs.bing.com/maps/2013/07/19/address-and-location-capture-in-dynamics-crm-with-bing-maps/

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans