Comments (13)
Fixed it!
from ionic-googlemaps-demo.
Did you git pull
of https://github.com/wf9a5m75/ionic-native/
, npm run build google-maps
and npm install (path to)/dist/@ionic-native/google-maps
?
Because I fixed this yesterday.
The constructor of LatLngBounds
is now:
constructor(southwestOrArrayOfLatLng?: LatLng | LatLng[], northeast?: LatLng) {
let args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
this._objectInstance = new (GoogleMaps.getPlugin()).LatLngBounds(args);
}
from ionic-googlemaps-demo.
Yes I'm on latest. The fix is fine and allowing an empty signature as constructor. Problem occurs when constructor is called with no parameters
from ionic-googlemaps-demo.
I work this line without no problem.
https://github.com/wf9a5m75/ionic-googlemaps-demo/blob/master/src/pages/geocoder/geocoding/geocoding.ts#L130
from ionic-googlemaps-demo.
Version af Android? I know it works for you. Just verify if the failing statement is executed in your case
from ionic-googlemaps-demo.
I tested on Android 6.0.1.
But this is JS problem, all code should work as same on any OS.
from ionic-googlemaps-demo.
I'm not sure the JS-version is the same on all platforms. I am running on 7.something.
But it fails here, so I can show you the call stack later.
Is it possible for you to inspect args[i] prior to the search?
from ionic-googlemaps-demo.
When calling like this
}).then((mvcArray: BaseArrayClass<GeocoderResult>) => {
let latLngBounds = new LatLngBounds();
let markers = new BaseArrayClass();
mvcArray.on('error').subscribe((error) => {
console.log(error);
});
you can see that the array arg contains one element "undefined"
If I on the other hand uses this to make the call (Define LatLngBounds with an empty array)
}).then((mvcArray: BaseArrayClass<GeocoderResult>) => {
let latLngBounds = new LatLngBounds([]);
let markers = new BaseArrayClass();
mvcArray.on('error').subscribe((error) => {
console.log(error);
});
the result is
where arg now is an empty array, and the code works fine.
I think that
constructor(southwestOrArrayOfLatLng?: LatLng | LatLng[], northeast?: LatLng);
that allows 0, or 1 of 2 parameters, but the code checks to see if the first element is an array, and if not then assumes its LatLng that has been passed, so it should check for no parameters like
var args = [];
if (arguments.length === 1 &&
typeof arguments[0] === "object" &&
"push" in arguments[0]) {
args = arguments[0];
} else {
if (arguments[0] != undefined) {
args = Array.prototype.slice.call(arguments, 0);
}
}
for (var i = 0; i < args.length; i++) {
if ("lat" in args[i] && "lng" in args[i]) {
this.extend(args[i]);
}
}
Then it works fine for me in both situations
from ionic-googlemaps-demo.
Oh, sorry, I haven't caught you up yet..
But thank you for inspecting.
from ionic-googlemaps-demo.
No need to excuse, I haven't been waiting :-)
It could probably also be fixed here
from ionic-googlemaps-demo.
Actually, I fixed this issue long time ago (especially on the marker cluster development).
And I merged the most of all code to the current multiple_maps branch.
I guess I merged after you tested.
Then the code becomes like this:
for (var i = 0; i < args.length; i++) {
if (args[i] && args[i] && "lat" in args[i] && "lng" in args[i]) {
this.extend(args[i]);
}
}
Since the code if (args[i]
blocks null
and undefined
, currently work fine if you execute new LatLng(undefined)
.
Please reinstall the plugin
from ionic-googlemaps-demo.
Hmm, interesting my version is still the code without the test.
I can see you committed the change 7th of July, and I can see I installed the plugin at the 28th of July, and in the demo project at 3rd of August
Anyway doing a clean install gave me the fixed version
By the way you might have merged it in twice as it now reads:
args[i] && args[i] &&
from ionic-googlemaps-demo.
Opps!
from ionic-googlemaps-demo.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ionic-googlemaps-demo.