I am trying to show a map that animates the percentages for several areas on the map. But javascript (which works in the browser) does not show animation or percentage at all. Webmpa.generateJs () generates javascript to animate percentages, and the initialize function is used to draw the map.
WebSettings settings = webView.getSettings(); settings.setAppCacheEnabled(true); settings.setDomStorageEnabled(true); settings.setDatabaseEnabled(true); settings.setJavaScriptEnabled(true); final WebMap webMap = new WebMap(); webView.addJavascriptInterface(webMap.getInterface(getActivity().getApplication(),this), "Android"); webView.setWebViewClient(new WebViewClient() { public void onPageFinished(WebView view, String url) { Log.d(TAG,webMap.generateJs()); webView.loadUrl("javascript:" + webMap.generateJs()); webView.loadUrl("javascript:initialize();"); } }); webView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null); webView.setBackgroundColor(Color.TRANSPARENT); webView.loadUrl(MAP_URL);
source share