I noted that bing maps provide only JSONP service to retrieve geolocation data (precisely Reverse Geocode locations).
So, if I need to retrieve only address info (without the map) from Bing via JavaScript and put them into a form, I have only 3 way:
- standard JS but with the logic constraint to attach the HTMLscript' tag
- using jQuery
- using AngularJS
So, using standard JavaScript with 'script' JSONP request tag isn't possible: violates the form structure integrity accessing the DOM!
Using jQuery, I hope it is compatible, but Microsoft Dataverse guidelines discourage using $.ajax
I think the third option (Angular) is the best practice but I don't have skills in this big JS library. Extend my VS projects with Angular complicates the management.
Finally, I don't want to achieve an address by Power Automate or Plugin because before, I have to detect the latitude and the longitude remaining on the same form. So working on the mobile form, calling the service by push-button on the Ribbon, all js client-side logic.
I don't want to perform reverse Geocode location by Power Apps Embedded Canvas App because Embedded Canvas Apps aren't still available for mobile in Model-driven apps layout.
XMLHttpRequest() is not compatibile for JSONP and it involves CORS logic.
So, Has anyone found another optimal solution with Web API or REST calls?
Returning to jQuery with MS Dataverse is very sad!
Link:
https://docs.microsoft.com/en-us/bingmaps/v8-web-control/map-control-concepts/rest-services-examples/
https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-point