откройте карты Google для соединения шиной направлений

Не пишите код, удаляйте код!

Как умный учитель однажды сказал мне: «Не пишите код, Написание кода - это плохо, Удаление кода - это хорошо. И если вам нужно писать код» - напиши маленький код ... "

9
задан Cœur 7 April 2019 в 12:08
поделиться

1 ответ

From MapKiWiki:

dirflg Route type:

  • dirflg=h - Switches on "Avoid Highways" route finding mode.
  • dirflg=t - Switches on "Avoid Tolls" route finding mode.
  • dirflg=r - Switches on "Public Transit" - only works in some areas.
  • dirflg=w - Switches to walking directions - still in beta.
  • dirflg=d - Switches to driving directions.

So your URL:

NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK";

Becomes:

NSString* urlString = @"http://maps.google.com/maps?saddr=London+UK&daddr=Birmingham+UK&dirflg=r";

N.B. The data supporting public transit route types are not always available. I tried the area you used in your sample (London, Birmingham) and found it was not supported.

23
ответ дан 4 December 2019 в 09:14
поделиться
Другие вопросы по тегам:

Похожие вопросы: