question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crush app with Google Maps v2 when you re-enter the page on iOS

See original GitHub issue

I’m submitting a … [ ] question [x] any problem or bug report [ ] feature request

plugin version: (check one with “x”) [ ] 1.4.x [x] 2.0.0-beta2

cordova information: (run $> cordova plugin list)

com.googlemaps.ios 2.3.0 "Google Maps SDK for iOS"
cordova-android-play-services-gradle-release 0.0.2 "cordova-android-play-services-gradle-release"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-battery-status 1.2.4 "Battery"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googlemaps 2.0.0-beta2-20170719-2226 "cordova-plugin-googlemaps"
cordova-plugin-mauron85-background-geolocation 2.2.5 "CDVBackgroundGeolocation"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
de.appplant.cordova.plugin.local-notification 0.8.5 "LocalNotification"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Current behavior: This happens only if an element is affixed to the map, for example, a marker. Without a marker, there is no error.

Previously, everything worked fine. The android works without problems.

Nobody faced such a problem? Any help will be appreciated. Thanks.

Expected behavior: App builds successfully.

Related code, data or error log (please format your code or data):

import { Component } from '@angular/core';
import { GoogleMaps, GoogleMap, GoogleMapsEvent, GoogleMapsMapTypeId, LatLng, MarkerOptions } from '@ionic-native/google-maps';

@Component({
	selector: 'page-map-route',
	templateUrl: 'map-route.html',
})
export class MapRoutePage {

	public map: GoogleMap;
	mapDiv: HTMLElement;
	marker: MarkerOptions
	constructor(
		private googleMaps: GoogleMaps
	) { }

	ionViewDidLoad() {
		this.loadMap();
	}

	loadMap() {

		this.mapDiv = document.getElementById('map');
	
		let map_location: LatLng = new LatLng(43.2566700, 76.9286100);
		
		let mapOptions = {
			mapType: GoogleMapsMapTypeId.NORMAL,
			controls: {
				compass: false,
				myLocationButton: true,
				indoorPicker: false,
				zoom: false
			},
			gestures: {
				scroll: true,
				tilt: true,
				zoom: true,
				rotate: true
			},
			styles: [],
			camera: {
				latLng: map_location,
				tilt: 0,
				zoom: 1,
				bearing: 0
			},
			preferences: {
				zoom: {
					minZoom: 0,
					maxZoom: 18
				},
				building: true
			}
		};

		this.map = this.googleMaps.create(this.mapDiv, mapOptions);
		
		this.map.one(GoogleMapsEvent.MAP_READY).then(() => {

			alert('ready');

			this.marker = {
				position: map_location,
				title: 'Test marker',
				styles : {
					'font-weight': 'bold',
					'color': '#336600'
				},
				icon: {
					'url': 'http://bvr.astanalux.kz/assets/images/start_point.png'
				}
			};

			this.map.addMarker(this.marker);

		});
	}

}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wf9a5m75commented, Aug 17, 2017

I’m sorry, but i’m not the ionic user. I could not understand what your point is.

0reactions
derasmuscommented, Aug 18, 2017

@wf9a5m75 Thank you for the quick & awesome support 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

SOLVED: Crush app with Google Maps when you re-enter the ...
Crush app with Google Maps when you re-enter the page on iOS. This happens only if an element is affixed to the map,...
Read more >
How to fix Maps when it crashes - iPhone & iPad
If the Google Maps app on your phone or tablet crashes or has other issues that affect your experience on Maps, try the...
Read more >
Overview | Maps SDK for iOS - Google Developers
The SDK automatically handles access to the Google Maps servers, map display, and response to user gestures such as clicks and drags. You...
Read more >
Drawing Route Between Two Places on GMSMapView in iOS
In that Application i am having 2 Fields From and To. I Entered Address using Google Auto Complete API.and also i am able...
Read more >
Adding Google Maps to a Flutter app - Google Codelabs
This codelab walks you through creating a Google Maps experience in a Flutter app for both iOS and Android. What you'll learn. How...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found