New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A desperate request for addPolylines in iOS #152
Comments
I've added the code (to GitHub) that comes close to what should be done, but it doesn't do much because of my previous remarks. |
Thanks for sharing Eddy! Have you talked about this with someone at Progress/Telerik? Is this something that needs to be address by the NS team or Mapbox? |
Not yet, but I think asking in the #ios channel on Slack would be a good start. I'm not able to do that atm though. |
You mean Slack channel of NS or Mapbox iOS? |
NativeScript Slack |
@EddyVerbruggen I did some adjustments to your code and I finally got some polylines in the map (yeah!!!): However, as you can see above, the route path is not the same as it should be (see the Android results). Any ideas why? I think it is related to this line (which I couldn't figure out how to write in plain JS - your sample is in TS): Here's the modification I did to your code:
|
That's a start! 😍 Can you share the app code to generate that "circle" on Android please? |
The "circle" is a real path saved on a Firebase database (thanks to your great Firebase plugin). App is huge, with several pages, Facebook login, etc. What is the best way to share it with you (I have no idea on how to use Github "repos/whatever you call them" :))? Will a zip file be enough for you? Do you have an email/dropbox I can share? Also, in order to get the same results of the "circle" you are going to have to log with my Facebook credentials. SO, let me know the best way to share it with you and I will gladly do that. |
Ah, ok, I was just wondering what you're doing to get that circle.. do simply call |
I got it. In fact, I just call it once, after finishing a flight (having saved it on FB database):
flightData is an array built by data from FB Realtime DB (full code below):
|
So if you're also using that on iOS then I don't get why this: var coord;
for (var p in points) {
var point = points[p];
coord = CLLocationCoordinate2DMake(point.lat, point.lng); // reassign
}
const polyline = MGLPolyline.polylineWithCoordinatesCount(coord, points.length);
theMap.addAnnotation(polyline); .. produces multiple lines (as per your screenshot). Because in the |
Using your code below "as is" did not produced any lines, as you probably know:
this was the reason I tried to move the last two lines out of the "for" loop. I also tried to simply leave the last 2 lines into the loop (commenting the coordRef one) without any success. Reason why I think there is "something" related with the line:
I think the solution is really close but, not being a "pro developer", I believe your knowledge can get the trick faster. |
@d3mac123 I've spent the morning taking the geojson route and seem to have something working. Don't worry, the API won't change as I'm leveraging geojson internally, that stuff will be hidden for the user. |
Add support for Polyline in IOS #41
This took me way longer than I hoped, but it's working now! Please update to 3.0.2. |
i think i am going to cry! :) thank you very much! |
First of all, I would like to thank @EddyVerbruggen for all the amazing plugins he builds. I've been using several of them and they are well documented, ready to use and constantly updated.
I am a designer, self-thought on how to code in Nativescript and who, thru try-and-error, learned also a few things to edit some of NS plugins (including Mapbox to auto-rotate maps).
Saying that, I am getting desperate because I really need my app (https://itunes.apple.com/us/app/ppg-finder/id1244768482?ls=1&mt=8) to render route paths (via addPolylines), as it does in Android.
I've been monitoring this open issue #41, having offered my time, payment, whatever, to get it implemented but, unfortunately, nobody seems to be checking that issue anymore.
If you have tried in the past to code it without success, please share your code and I will do my best to re-evaluate/test/pray/fast/whatever!!!!
Sorry for opening another case for the same topic but, like I said "it is desperation time".
Cheers,
Alex
The text was updated successfully, but these errors were encountered: