Having trouble integrating Ionic Native API and Javascript API in one application?

Currently, I am developing an application using Google Maps that utilizes both the Ionic Native Google Maps API and the JavaScript version. The Native API is implemented on a page called home.ts, while the JavaScript API is utilized on a sub-page called details.ts that can be accessed by tapping on the infoWindow of a marker.

Interestingly, the setup seems to be working well for me so far. However, it seems that I need to import "GoogleMaps" from @ionic-native/google-maps into both details.ts and home.ts in order for the map images to load properly on the main page, while the markers and other functionalities work fine without any issues.

Unfortunately, the reason I need to use both APIs is that Ionic Native does not currently support the Google Places API. This has led to a potential problem that I have encountered -

On iOS devices, the app has a sporadic tendency to crash or freeze during transition events, such as switching between pages (the common trigger) or simply panning around the map generated by details.ts. When this crash occurs, the error message displayed in XCode resembles the following:

*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[2]

It seems that the number in objects[2] can vary in each occurrence.

Although I have not observed this issue in the Android version of the app yet, I have a suspicion that it may be present. I have discussed this with someone who believes that the app might occasionally try to access the wrong API. However, I am seeking further insights and potential complications that could arise from such a setup.

Answer №1

When integrating Ionic with Google Maps, some Cordova plugins may encounter issues. It is recommended to refer to the Google Maps JavaScript documentation or watch the tutorial at

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Converting Node JS request to an API into React Fetch syntax

I have encountered a problem while developing an app in React-Native that connects with the Hubspot API. Initially, I tried to make the request using the Node JS request module, but it didn't work well with React Native when Expo was involved. Now, I ...

The basic shapes in the scene are just out of sight

Sorry for the easy question, but I'm having trouble getting the BoxGeometry to show up in the scene. The red background is displaying correctly. var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(0, window.innerWidth / window.inn ...

Developing a versatile Angular2 component that has the potential to be utilized across various sections of a website

Use Case: I need to display a processing screen during asynchronous calls to keep end users informed about ongoing activities across multiple sections of the website. To achieve this, I decided to create a reusable component at the global level. Issue: As ...

Determining the type of expression in swift4 can be confusing without additional context

I encountered the following error message: "Type of expression is ambiguous without more context swift4" I am working on creating a local notification reminder feature for an iPhone app using Xcode 9 and Swift 4. import UIKit @UIApplicationMain class ...

javascript issue with onchange query

The JavaScript snippet below is included in the head section of my file. <?php echo "<script language='JavaScript'>\n"; echo "var times = new Array();\n"; echo "times[0] = 0;\n"; foreach($times as $time) { echo "times[". ...

What is the process for displaying all cookies in node.js?

I recently wrote some node.js code to retrieve cookies for a specific route. router.get('/', function (req, res, next) { var cookies = req.cookies; res.render('cartoons', { Cookies: cookies, }); }); In my cartoons Jade file, the ...

Is there a way to access an iPhone user's "My Info" contact database record through an API call?

Recently, I noticed that in the most recent version of iOS (uncertain about earlier versions), there is a "My Info" feature that allows users to select their preferred ContactDB record on their device. Is there an API request available to retrieve this in ...

Unable to communicate between react components

I am currently working on a project using React JS (jsfiddle). The issue I am facing is that the textbox does not update with the true/false value of the checkbox when it is checked. Can anyone provide insight into why this might be happening? var Custo ...

Using jQuery to automatically scroll to the bottom of a div when sliding down

When a user clicks on a link to slide the div down, I want it to automatically scroll to the bottom of the div. I've attempted to use scrollTo and animate methods to achieve this effect. $('html, body').animate({ scrollTop: $("#elementID") ...

Embed a YouTube video within the product image gallery

Having trouble incorporating a YouTube video into my Product Image Gallery. Currently, the main product photo is a large image with thumbnails that change it. You can see an example on my website here. Whenever I attempt to add a video using the code below ...

Eliminate any undefined data in the popup map of Javascript

I am working with JSON data that is being displayed in a pop-up on a map. In cases where there is missing data (Visibility), the word undefined appears in the pop-up. Is there a way to remove the undefined text so that it does not show up in the pop-up? ...

Is it possible to use a Backbone Model for an unconventional HTTP POST request that isn't

After going through the documentation at and , I tried to make an HTTP POST request to fetch some JSON data for my model. However, due to the services not being RESTful, I ended up using a POST request instead of a GET request. The code snippet I have co ...

Is there a way to customize the outlined color of an input adornment in MUI?

Looking to customize the default blue color in a Form Control outlined variant, but can't figure out how. I was able to do it with a regular TextField, but this one is a bit trickier. <FormControl variant="outlined"> < ...

The AJAX validation process fails to run prior to the execution of the login PHP script

My attempt to implement AJAX for form validation is not successful and I'm unsure why. Despite my efforts, the form still redirects to login_action.php instead of performing the AJAX validation as intended. I have designed a modal login form and wish ...

Guide on parsing JSON data received from the frontend

Here is the HTML code that I am working with: <div id="loginform"> <form class="loginIn" name="loginform"> <input type="text" name="login"> <input type="password" name="password"> <input type="submit" value="Войт ...

Issue with Accordion Panel Content Scroll Bar

Hello there, I've encountered a puzzling problem with my website. My objective is to insert a Time.ly Calendar widget into one panel of my accordion. On this page, "TOURNAMENTS: , the widget appears exactly as desired. However, when I replicate the c ...

HTML filtering using the <select> element

Is there a way to implement this script for options instead of buttons? The goal is to filter the HTML section, but it seems to not work with <option> tags. Instead of displaying the all class, it shows nothing. CSS .show { display: block; } .filt ...

Is there a solution to address this login code with multiple queries in Mongoose?

**I am currently in the process of creating a login route that can accept either a username or email. However, I encountered an issue where one field is being set to undefined when the other field is available, resulting in an error. My regex is specific ...

Why is the error message for ``NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)`` only appearing on certain iPhones

I'm encountering an issue where one of my apps is unable to connect to its API server. The error message I'm seeing is NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813). I've been struggling to identify the root ...

What is the process for storing user-provided document names in Firestore database entries?

I'm encountering an issue with my API while trying to utilize Firestore for inputting data for login and registration via the API. The problem arises when attempting to add a document entry in the database with the user's input email during regis ...