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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 107

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 59 Super User 2026 Season 1

#3
sannavajjala87 Profile Picture

sannavajjala87 29

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans