tudorf Active Member Licensed User Longtime User Aug 18, 2012 #1 Hi I experiment with GoogleMapsWebView. I can´t see the standard Zoombutton (+/-) on the screen. Change the zoom with 2 fingers is terribel. The map jumps extrem. So I want to add 2 Button für change Zoom. I added a function in Javascript and start the function from b4a. I can´t change the Zoom. Why. In Html function zoomchange(ZoomLevel){map.SetZoom(ZoomLevel);} In Button_Click Dim Javascript As String ZoomLevel = ZoomLevel + 1 Javascript="zoomchange("&ZoomLevel&")" 'Javascript="zoomchange(11)" MapViewerExtra.executeJavascript(MapViewer, Javascript) Martin
Hi I experiment with GoogleMapsWebView. I can´t see the standard Zoombutton (+/-) on the screen. Change the zoom with 2 fingers is terribel. The map jumps extrem. So I want to add 2 Button für change Zoom. I added a function in Javascript and start the function from b4a. I can´t change the Zoom. Why. In Html function zoomchange(ZoomLevel){map.SetZoom(ZoomLevel);} In Button_Click Dim Javascript As String ZoomLevel = ZoomLevel + 1 Javascript="zoomchange("&ZoomLevel&")" 'Javascript="zoomchange(11)" MapViewerExtra.executeJavascript(MapViewer, Javascript) Martin
warwound Expert Licensed User Longtime User Aug 18, 2012 #2 Hi again. Javascript is case sensitive so your javascript function should be: Code: Copy function zoomchange(ZoomLevel){map.setZoom(ZoomLevel);} (setZoom and not SetZoom). https://developers.google.com/maps/documentation/javascript/reference#Map I mentioned in your other thread that using WebViewExtras and it's addWebChromeClient method will enable all errors to be viewed in the B4A log - it'd make debugging simple errors such as this much easier for you. Martin. Upvote 0
Hi again. Javascript is case sensitive so your javascript function should be: Code: Copy function zoomchange(ZoomLevel){map.setZoom(ZoomLevel);} (setZoom and not SetZoom). https://developers.google.com/maps/documentation/javascript/reference#Map I mentioned in your other thread that using WebViewExtras and it's addWebChromeClient method will enable all errors to be viewed in the B4A log - it'd make debugging simple errors such as this much easier for you. Martin.
tudorf Active Member Licensed User Longtime User Aug 18, 2012 #3 Martin You meen Online JavaScript beautifier ? Sorry I dont understand what you meen. My englisch is very bad. I have added the code in the Online JavaScript beautifier. The code was formated. Can I run und test the code? I can´t find it. I can´t find a different between map.setZoom(zoomlevel) and map.setzoom(zoomlevel) in the program. Martin Upvote 0
Martin You meen Online JavaScript beautifier ? Sorry I dont understand what you meen. My englisch is very bad. I have added the code in the Online JavaScript beautifier. The code was formated. Can I run und test the code? I can´t find it. I can´t find a different between map.setZoom(zoomlevel) and map.setzoom(zoomlevel) in the program. Martin
warwound Expert Licensed User Longtime User Aug 21, 2012 #4 tudorf said: In Html function zoomchange(ZoomLevel){map.SetZoom(ZoomLevel);} Click to expand... Sorry for the delayed response! You can see there that you'd used SetZoom instead of setZoom - maybe it was just a typo? Did you get this working? Did you add the WebChromeClient to your webView and see any javascript errors being logged? Martin. Upvote 0
tudorf said: In Html function zoomchange(ZoomLevel){map.SetZoom(ZoomLevel);} Click to expand... Sorry for the delayed response! You can see there that you'd used SetZoom instead of setZoom - maybe it was just a typo? Did you get this working? Did you add the WebChromeClient to your webView and see any javascript errors being logged? Martin.
tudorf Active Member Licensed User Longtime User Aug 24, 2012 #5 Hello Martin Thanks. The program runs very fine. Martin Upvote 0