web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

click on marker on google maps does not open window in dynamics 365 mobile app

(0) ShareShare
ReportReport
Posted on by 15

Hi,

I built a model-driven app, in which i have a custom entity, which includes the address latitude and longitude, then i wanted to show this on an integrated google map (html web resource), and added a marker and the directions url to this marker so when the user clicks on the marker it would open google maps app (on the phone).

so my code is working and i am able to open google maps when i click on the marker if i am using a browser, but when i am using the Dynamics 365 mobile app, the click does not work!

so is this some kind of a bug or restriction? i hope someone would answer it.

so here is my java script code to check it.

function initialize() {
            'use strict';
            var map_canvas = document.getElementById('map_canvas');
            var map_options = {
                center: new google.maps.LatLng(33.3116075, 44.2158218),
                zoom: 6,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            var map = new google.maps.Map(map_canvas, map_options);
            var geocoder = new google.maps.Geocoder();
            var lat = window.parent.Xrm.Page.data.entity.attributes.get('drm1_addresslatitude').getValue();
            var lon = window.parent.Xrm.Page.data.entity.attributes.get('drm1_addresslongitude').getValue();
            var address = lat   ","   lon;
            geocoder.geocode({ 'address': address }, function (results, status) {
                if (status === google.maps.GeocoderStatus.OK) {
                    map.setCenter(results[0].geometry.location);
                    map.setZoom(14);
                    var marker = new google.maps.Marker({
                        map: map,
                        position: results[0].geometry.location,
                        url: "https://www.google.com/maps/dir/?api=1&destination="   results[0].geometry.location
                    });
                    /*var infoWin = new google.maps.InfoWindow();
                    google.maps.event.addListener(marker, 'click', function () {
                        infoWin.setContent(marker.url), infoWin.open(map, marker);
                    });*/
                    google.maps.event.addListener(marker, 'click', function () {
                        window.open(marker.url);
                    });
                } else {
                    //alert("Geocode was not successful for the following reason: "   status);
                }
            });
        }

        google.maps.event.addDomListener(window, 'load', initialize);

I have the same question (0)
  • Suggested answer
    Henry J. Profile Picture
    5,237 on at

    Hello,

    Good question, I know the window.open method wasn't supported in the past on mobile (docs.microsoft.com/.../dn481572(v=crm.8) but I'm unsure if it is still the case today.

    Do you use the latest Dynamics 365 for Phones app version?

    Might be worth to open a Support Request to investigate this further: admin.powerplatform.microsoft.com/support

    Henry

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans