Question

I am developing an iPhone application which uses google maps.

For the same application, I use google direction WebService to get direction between 2 locations. I fetch encoded polyline from google direction web service response and decode it.

After decoding i have list of coordinates between to locations & joining these coordinates to the coordinates alongside it, I get the complete direction.

But the problem is that this joining (rendering) the coordinates takes too much time which is not at all user-friendly.

One strange thing is that the time this rendering takes increases each time I render a direction.

Note : Each time I render direction for different locations. Is there anyone who faced the similar problem?

Was it helpful?

Solution

I got my answer. If there are 100 coordinates in the polyline of direction then do the following :
[path addCoordinate:coordinate1]
.
.
.
100 times to add all coordinates
.
.
.
[path addCoordinate:coordinate100]

What I was doing is joining first two coordinates then join 2nd and 3rd coordinates...join 99th and 100th coordinate.

Now, adding all coordinates solved the problem and it takes less than a second.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top