private void updateMarker(MapPos pos, Map<String, String> toolTips) { if (clickMarker != null) { String text = ""; if (toolTips.containsKey(UtfGridHelper.TEMPLATED_TEASER_KEY)) { // strio HTML from the teaser, so it can be shown in normal // String strippedTeaser = // android.text.Html.fromHtml(toolTips.get(UtfGridHelper.TEMPLATED_TEASER_KEY).replaceAll("\\<.*?>","")).toString().replaceAll("\\p{C}", "").trim(); // Toast.makeText(activity, strippedTeaser, Toast.LENGTH_SHORT).show(); // Log.debug("show label ") text = toolTips.get(UtfGridHelper.TEMPLATED_TEASER_KEY); } else if (toolTips.containsKey("ADMIN")) { text = toolTips.get("ADMIN"); } clickMarker.setMapPos(pos); mapView.selectVectorElement(clickMarker); WebView webView = ((WebView) ((ViewLabel) clickMarker.getLabel()).getView()); Log.debug("showing html: " + text); webView.loadDataWithBaseURL( "file:///android_asset/", UiUtils.HTML_HEAD + text + UiUtils.HTML_FOOT, "text/html", "UTF-8", null); clickMarker.userData = toolTips; } }
private void updateMarker(MapPos pos, String text) { if (clickMarker != null) { clickMarker.setMapPos(pos); mapView.selectVectorElement(clickMarker); WebView webView = ((WebView) ((ViewLabel) clickMarker.getLabel()).getView()); Log.debug("showing html: " + text); webView.loadDataWithBaseURL("file:///android_asset/", text, "text/html", "UTF-8", null); } }