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];