2

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?

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
Geek
  • 8,280
  • 17
  • 73
  • 137
  • I've noticed the UI becoming unresponsive when adding more then 300 shapes or markers at one time. Although the map works well with thousands after they have been added. Adding shapes and markers in the background is also not supported. – jspooner May 11 '13 at 15:20
  • @jspooner In my case I add a path with around 100-150 very small polylines. When I render next path each time it takes considerably longer time than previous rendering. – Geek May 12 '13 at 11:13

1 Answers1

0

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.

Geek
  • 8,280
  • 17
  • 73
  • 137