Google Map Error “Uncaught TypeError: Cannot read property 'x' of undefined”
问题 I am working with Google map and I wrote a JS code like below and it works perfectly when a user gives location realizing permission by Browser, but when he blocks the permission, the map doesn't show anything and wen I click on its area I get the following error:\ Error: Uncaught TypeError: Cannot read property 'x' of undefined JS SCRIPT: var pos = new Object(); var marker1 = new Object(); var marker2 = new Object(); var resp; var loc; var bus_loc; function initMap() { var map = new google