I have used Google map v3 in a local html file which loads in a webview b

I have used google map using javascript. Initially it was working fine but now it is not working. The basic html page in not being loaded in Safari / Chrome also.

Blank page in showing in webview when I am using this below code. Can anyone please help me this?


Sample Code:


basicmap.html

<!DOCTYPE html>

<html>

<head>

</head>

<body>

<div id="map"></div>

<script>

function initMap() {

// Create a map object and specify the DOM element for display.

var map = new google.maps.Map(document.getElementById('map'), {

center: {lat: -34.397, lng: 150.644},

scrollwheel: false,

zoom: 8

});

console.log(map);

}

</script>

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCr-LWpFp_7h0MziegSBBTf8ODvByYwbaw&callback=initMap"

async defer></script>

</body>

</html>



ViewController.m


NSURL *url = [[NSBundle mainBundle] URLForResource:@"basic" withExtension:@"html"];

[_webView loadRequest:[NSURLRequest requestWithURL:url]];

[self.view addSubview:_webView];

The basic html page in not being loaded in Safari / Chrome also.

Realistically, if your code to load a Goole web page in Google’s browser is not working, it seems like it’d be best to pursue this via Google’s support resources. Once you have it working in Chrome, you can then check that it also works in Safari. If so, you can then tackle the web view issue.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
I have used Google map v3 in a local html file which loads in a webview b
 
 
Q