javascript - How change a google maps without access to original variable -


currently creating greasemonkey script change map on external site. site create google maps object inside private function , need add circle on map but, dont have access original map creation variable (created inside funcion). cenario moreless , cannot change creation function (is greasemonkey script):

function createmap() {  var map = new google.maps.map(document.getelementbyid('map'), {           zoom: 18,           center: {lat: 10.10, lng: 11.11},           maptypeid: 'terrain'         }); } 

the "createmap" funcion provided original site , have lot of functions inside (i put here example). "map" variable private on function scope , cant change (i not have access site source code).

so, need create circle element inside map using greasemonkey script. on documentation , not found way "list of maps on current page" or liked try add...

i need add code... dont know how can populate new "map" variable "pointer" created map on page.

var validrange = new google.maps.circle({      strokecolor: '#ff0000',      strokeopacity: 0.8,      strokeweight: 2,      fillcolor: '#ff0000',      fillopacity: 0.35,      map: map,      center: {lat: pagedata.lat, lng: pagedata.lng},      radius: 40 }); 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -