Coder Social home page Coder Social logo

Comments (11)

sarweshkumar47 avatar sarweshkumar47 commented on June 5, 2024

@aurangzaibumer777 Are you asking about getting the list of latlng points of a curve drawn on google maps? If not, can you give me little more details to understand your question better?

from curve-fit.

aurangzaibumer777 avatar aurangzaibumer777 commented on June 5, 2024

yes, you're right. i need to have list of latlng that google map draws when geodesic is set to true.
like this https://i.stack.imgur.com/EArBf.png
for suppose if i want a geo desic polyline from one point to another (london to istanbul, turkey), the polyline ARC/CURVE will be created by google if i give it both latlng of source and destination and set geodesic property to TRUE but can i have those drawn arc points (which will be set of latlngs or list of latlngs) that google map creates
thanks

from curve-fit.

aurangzaibumer777 avatar aurangzaibumer777 commented on June 5, 2024

actually i want geodesic polyline to animate like this
https://smdaudhilbe.wordpress.com/2014/11/30/how-to-animate-line-gradually-growing-from-starting-point-to-ending-point/
for that, i need set of points so i could pass it to object animator in order to animate the line from one point to another.

from curve-fit.

sarweshkumar47 avatar sarweshkumar47 commented on June 5, 2024

yes, you're right. i need to have list of latlng that google map draws when geodesic is set to true.
like this https://i.stack.imgur.com/EArBf.png
for suppose if i want a geo desic polyline from one point to another (london to istanbul, turkey), the polyline ARC/CURVE will be created by google if i give it both latlng of source and destination and set geodesic property to TRUE but can i have those drawn arc points (which will be set of latlngs or list of latlngs) that google map creates
thanks

To get a list of LatLng points of a Curve, register a callback interface to be invoked when the curve is drawn on google maps.

curveManager.setOnCurveDrawnCallback(this);

Use getPoints() method of a Curve reference which returns a list of LatLng points.

@Override
public void onCurveDrawn(Curve curve) {
    List<LatLng> latLngList = curve.getPoints();
}

To get a list of LatLng points of a geodesic polyline, call getPoints() on a Polyline reference.

Check the below link for more info.

https://gis.stackexchange.com/questions/194532/how-to-get-polyline-latitude-and-longitude-by-click-on-polyline-android

I hope the above is useful to you.

from curve-fit.

aurangzaibumer777 avatar aurangzaibumer777 commented on June 5, 2024

but the library of your curve draws a different curve than the geodesic
can't it be possible to draw a simple geodesic polyline and get points? the getpoints of polyline gives the source and destination points only, not all the points

from curve-fit.

sarweshkumar47 avatar sarweshkumar47 commented on June 5, 2024

I wanted to draw curves similar to this (https://drive.google.com/file/d/1BQTDpvN7KaRfWJ4NJt1lsStLT8e5uYSK/view?usp=sharing).

Setting the geodesic option to true did not help me much when I was working on a project. So I decided to use the Bezier cubic equation to draw a curve between the 2 points.

The curve drawn by the library, consists of several small polylines (200 points). AFAIK, setting the geodesic option to true does not make much difference here.

You can try one more trick. Use setAlpha option and set the alpha value to zero and you will get a straight line in most cases. After that, try to get a list of points of a curve (Make sure it satisfies your requirement). If you want a perfectly straight line, use setComputePointsBasedOnScreenPixels option and set it to true (Read the limitation of this method before using it).

from curve-fit.

aurangzaibumer777 avatar aurangzaibumer777 commented on June 5, 2024

no, i actually want to have a geodesic curve and i need an animation like i showed you with a reference link

from curve-fit.

aurangzaibumer777 avatar aurangzaibumer777 commented on June 5, 2024

the same geodesic curve being drawn by google map.
in iOS, we get the same points using GMSGeodesicPolyline, in Android, we got nothing or maybe we need some more digging.

from curve-fit.

sarweshkumar47 avatar sarweshkumar47 commented on June 5, 2024

no, i actually want to have a geodesic curve and i need an animation like i showed you with a reference link

If you want a geodesic curve/line drawn by the google map, try to use polyline directly. Let me know if you find any solution to your problem.

from curve-fit.

aurangzaibumer777 avatar aurangzaibumer777 commented on June 5, 2024

no, i actually want to have a geodesic curve and i need an animation like i showed you with a reference link

If you want a geodesic curve/line drawn by the google map, try to use polyline directly. Let me know if you find any solution to your problem.

unfortunately i have no way but to use the google map polyline but i need to animate it (just like in the reference link)

from curve-fit.

sarweshkumar47 avatar sarweshkumar47 commented on June 5, 2024

Closing because of inactivity.

from curve-fit.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.