I am trying to render javascript markers on google maps in WebView, but markers are not showing in WebView.
I have set
binding.webView.setWebViewClient(webViewHelper);
binding.webView.setWebChromeClient(new WebChromeClient());
binding.webView.getSettings().setJavaScriptEnabled(true);
binding.webView.getSettings().setDomStorageEnabled(true);
binding.webView.getSettings().setLoadWithOverviewMode(true);
binding.webView.getSettings().setUseWideViewPort(true);
binding.webView.getSettings().setBuiltInZoomControls(true);
binding.webView.getSettings().setDisplayZoomControls(false);
binding.webView.getSettings().setSupportZoom(true);
binding.webView.getSettings().setDefaultTextEncodingName("utf-8");
binding.webView.getSettings().setLoadsImagesAutomatically(true);
in WebView Settings. Map is rendered but still not showing the markers. Markers are showing outside of WebView. Does anyone have any solution on how to render javascript markers on WebView?
After going through the developer documentation adding webView.getSettings().setMixedContentMode (MIXED_CONTENT_ALWAYS_ALLOW);
fixed the issue.
Related
I have this site here that I built for a client but the Google Maps API is not working correctly. If you go to the site, click the contact us link in the nav bar. You will see the map not showing, then if you just reload the page two or three times the map will show.
I copied and pasted the exact link from Google into my HTML file, with the API key that they gave me. I also borrowed a file called gmaps.js, which you can search for on Google, and implemented the map in my javascript file with the following code:
/* MAPS */
new GMaps({
div: '.map',
lat: 42.2803784,
lng: -83.7301047
});
The github repo is public and can be viewed here:
https://github.com/seanrobenalt/cosasabrosa
The problem doesn't seem to be too complicated but I can't figure it out. Hoping somebody is willing to take a look...
I have a problem with a map that contains a geo-location, directions and markers. The map is the start screen which is directly shown after the app launches. I want the map to show geolocation (position) and markers, but i have to reload it (ripple emulator), to see what i want. After the app launches, the map is clear and no geolocation or markers are shown.
I think the script may not load to 100%, sometimes it works without giving me this problem.
I use cordova, initialize the map in this classic way bottom script:
google.maps.event.addDomListener(window, 'load', initialize);
and to call :
<div id="map-canvas"></div>
API and script and I put the code on the top of the page.
Apparently it does not work at all, in the device map does not load the function or disappear when you "zoom " and runs very slowly
I'm developing an app whit phonegap (cordova). This app includes a google map with some markers.
The app also has more pages as a list of comerces…
The map shows correctly, but when I change the page, and back to the map page, sometimes the map is displaced and the info windows not open correctly.
Is there any way to put a map and it appears correctly when changing pages?
And I have also seen that the map consuming a lot internet data.
Could someone make me a suggestion?
I hope someone can help me!!
Thanks, and excuse me for my bad english.
I had similar problems with google maps and cordova. I was using jquery-mobile and sometimes if you switch between pages the maps wasn't loaded properly. You can check out different page events and try to "resize" the maps. I was also playing with different version of cordova and jquery-mobile. This could help as well.
$(document).on("pagebeforeshow","#pagetwo",function(){
google.maps.event.trigger(map, 'resize');
});
best
M
I am following this link to create Adsense on GMAP https://developers.google.com/maps/documentation/javascript/examples/ads-adunit
But when i implemented it on my website only ads and some part of MAP only highlighted, I also tried to debug the view from the firebug tool but not found any hidden property or error. The same code i have implemented.
pastebin.com/AbEEExSa
Since it shows grey color in the map-canvas, it seems to be a refresh problem. This can be solved by triggering the resize of the Google maps.
google.maps.event.trigger(map, "resize");
Try adding this line after the completion of adunit API(success callback of this API).
FYI:
resize : Developers should trigger this event on the map when the
div changes size: google.maps.event.trigger(map, 'resize').
Updates:
I tried using the code that you have pasted in codebin, removing the php and parts that you have commented. It is working. I'm not sure what your php code does. So try debugging like in the fiddle.
I am able to show Geoserver map using webview (In android) and want to show marker on geoserver map in my android application.
Please suggest how to achieve this.
Hope to hear from you soon.
Regards,
Parmanand Soni