This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @ExperimentalCoroutinesApi | |
| fun initMap( | |
| map: CustomMapFragment, | |
| addresses: ArrayList<String>, | |
| callback: (points: ArrayList<LatLng>) -> Unit | |
| ) { | |
| CoroutineScope(Dispatchers.Default).launch { | |
| //функции, вызванные через GlobalScope.async будут исполняться параллельно | |
| val googleMap = GlobalScope.async { getGoogleMap(map) } | |
| val points = GlobalScope.async {getPoints(map, addresses)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Использование во fragment | |
| MapUtils.initMap(map, addressesNames, handlePointsCallback) | |
| class MapUtils { | |
| companion object { | |
| //Функция инициализация карты и отрисовки на ней точек | |
| @ExperimentalCoroutinesApi | |
| fun initMap( | |
| map: CustomMapFragment, | |
| addresses: ArrayList<String>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Использование во fragment | |
| MapUtils.initGoogleMap(map) { googleMap -> | |
| MapUtils.setupMap(context, googleMap, handlePointsCallback) | |
| } | |
| class MapUtils { | |
| companion object { | |
| //Получаем карту. Callback вызывается в UI потоке | |
| fun initGoogleMap( | |
| map: CustomMapFragment, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- before clearing --> | |
| <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
| <soap:Body> | |
| <m:Response xmlns:m="tp.mobile"> | |
| <m:return xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <m:name>Object name</m:name> | |
| <m:error>Errors count</m:error> | |
| <m:objects_qty>Objects count</m:objects_qty> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- до очистки --> | |
| <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
| <soap:Body> | |
| <m:Response xmlns:m="tp.mobile"> | |
| <m:return xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
| <m:name>Название объекта</m:name> | |
| <m:error>Кол-во ошибок</m:error> | |
| <m:objects_qty>Кол-во объектов в ответе</m:objects_qty> |