Cordova problems with google map - javascript

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

Related

Google map loads only if I resize the browser window

I´m working on a google maps implementation and it works fine so far. To try things and play around with it I made an extra file for that.
Here you can checkout the map: Google maps file
I have everything ready in that file and I want to implement that to my website. I took the code and copied it to my "main-file".
Now, the google-map won´t load in the first place, only if I resize the browser or write something in the text field.
The browser doesn´t give me any errors back.
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOURAPIKEY&callback=initMap&language=de">
This Code-Sample is on the end of my <body>-tag. I know that google-map needs to load async, but I´m not realy sure what it is, because - I´m a beginner...
Can anyone give me a hint why the map is acting like that?
All javascript-files that are needed are implemented.
Google maps seem to be showing without resizing the window though.
If it's not showing, try adding "resize" event trigger on map load. It is the same event for window resizing.
function initMap() {
var map = new google.maps.Map(document.getElementById('newjobmap'), options);
google.maps.event.trigger(map, "resize");
}

Google Maps Javascript API Doesn't Respond to Touch Events in iOS 10

I run a website with a number of custom Google Maps built in (showing various locations on a map after a search or generating directions to/from a location). I use Google Maps Javascript API for this. My users have started reporting that on iOS 10, these maps no longer respond to touch events -- they cannot pinch-to-zoom nor can they click on the "pins" on the map to open the location info balloons.
I've been searching all over for others who have had this issue to no avail. I found one StackOverflow question here (http://webcache.googleusercontent.com/search?q=cache:DaiSdOgD0U4J:stackoverflow.com/questions/39401974/google-maps-javascript-doesnt-pan-or-zoom-in-ios-10+&cd=3&hl=en&ct=clnk&gl=us), but it was downvoted, then deleted. (Why?) A fresh search today still shows that page, but it leads to a 404, making a search even more frustrating.
Has anyone else experienced this? Is this a bug within the Google Maps API? I certainly can't find anything about that on their Developer website. Am I possibly doing something very wrong to lead to this? The code has worked for years and hasn't been modified in a few months now, so nothing changed on our end.
We do use an API key in our requests
I've tried switching from the
current release version (3.25) to the current experimental version
(3.26) with no changes in functionality.
Users report this happens in at least both Safari and Chrome on iOS 10
Just hoping someone can provide any insight at all on the issue.
Ok here is how I did to fix this issue.
As a reminder i'm using AngularJS via the Ionic framework.
I was calling the map this way in my index.html :
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=true"></script>
It seams like signed_in feature of google map is adding a layer on the map that is not letting the map getting the X,Y of your screen touch position.
I just replaced by false to disable the signed_in feature and its working like a charm
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=PUT_YOUR_GOOGLE_API_KEY_HERE&signed_in=false"></script>

CSS or JavaScript Conflict - Google Map Won't Display

The WordPress theme I am using has built in JavaScript and CSS for Google maps on the contact page. So, I'm guessing there is conflicting code. I can't seem to find where the conflict is when I am trying to use a plugin which also uses Google Maps.
I would really appreciate any help correcting this issue so that this Google Map will display instead of an empty gray box. I tried everything I know to do.
http://boothambuilders.com/service-area/
The plugin works on all other themes I'm using.
Also, this is the only page where the background doesn't display properly. I don't know how it is related to the issue.
It is not a CSS conflict, you are calling the Google Maps API twice...

Configure Javascript in android for showing marker in geoserver

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

Conflict with Google maps V3 API and MooTools

I'm have a conflict with Google Maps v3 API and Mootools. For some reason when the page where the maps is on is loaded it looks fine but about 10 seconds later the map disappears as well as all but 1 pin point.
You can see it here: http://goo.gl/Sr0b2
If I remove mootools.js which loads in my footer, the problem goes away but then some of the javascript on my WordPress theme doesn't work such as the drop down menu in the header so removing mootools is not an option.
Anyone know what may be causing the conflict and how I can fix it?
Any help is appreciated.
I solved the problem by using an iframe for the map, this way the mootools.js on the page doesn't affect the map script. I usually don't use iframes but in this situation it doesn't affect the site's SEO or anything else and it's a perfect solution. So if you have this same issue you can load the map on a page of its own (with nothing but the map) and then insert it anywhere with

Categories

Resources