c# - WebBrowser using Google map shows script error after it loaded a couple of times succesful -


i working on c# windows form application , show google map in application through webbrowser control google map direction url

here url of google map direction m putting url in winform webbrowser navigate , show me map give him addresses point , adresses come **textboxes**

here c# code :

webbrowser1.navigate(        @"https://www.google.com/maps/dir/" +         textbox1.text +         "/" +         textbox2.text +         "///@28.1925465,68.3193684,7z"); 

working fine sometime , shows me script error when sript error navigate , google map stuck in c# webbrowser control if surpress script error error hide map still in stuck position.

how can solve this?

you can using gds google map winforms control. here how:

  1. drag gdsgooglemap form, name _gdsgooglemap , set dock property "fill";

  2. create event handler map initialized event , code as:

        private void ggdsgooglemapmapinitializedeventhandler(object sender, mapinitializedeventargs e) {     _gdsgooglemap.mapzoom = 8;     _gdsgooglemap.mapcenter = new latlng( -34.397, 150.644 ); } 
  3. compile , run program , see google map shows centered @ lat lng provided.

if want change center or zoom, reset mapcenter property or mapzoom property.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -