📜 ⬆️ ⬇️

Transport of St. Petersburg, iOS application

When on March 6th we published information about the Transport Portal of St. Petersburg , I immediately undertook to study their website. Less than a day later, the first version of the application was already based on a hastily collected html page, of course, I wasn’t released in the app store, although everything worked quite quickly.

image


Under the cut, I'll tell you what happened from all this.
imageimage
')


Choosing a framework


Google prohibits the use of its cards for such paid applications, so the native map-kit was rejected. html-based applications with creak are being tested, apple advises to rewrite everything to html5, but right there maps with a standard framework. And in general it is clear that we must look for "native" ways.

As a result, with the help of the same Google, I stopped at the route-me framework, or rather its fork from Alpstein. Google also gives a strange answer to the question about layers: it is proposed to sculpt the entire map one on top of another and synchronize touch events. A good, good sandwich should be made.

I had to rewrite the framework to support the layers, the sources are still published in the form of a patch, they don’t reach their hands. Alpstein's people for some reason do not want to drag changes to themselves, although in my opinion, this is about basic functionality. The essence of the modification is that in UIScrollView not a view with a map is added, as in the original code, but a view container. In the container there are views with maps. A couple of methods to add new tileSources and insert them at a given index, and that's it.

Portal


There have already been articles about both the android version and html, but for some reason the functionality of these applications is reduced only to the display of layers with transport. Therefore, I still say a few words about how to do more.

The main tools here are browser, wget and some sniffer to choose from: ngrep, tcpdump, tcpflow, for the lazy there is also a graphical HTTPScoop. Crawling on the portal and studying the requests, we managed to find out that almost everything is built on json, and the tables on datatables. I formed my requests to datatables, just in case pulling out information in chunks of 25 pages, as is done on the portal itself. This way you can get a list of routes, a forecast for stops, maybe something else.

The next moment is a thoughtful study of the portal pages. There were hidden unused, but very useful methods for me. Layers with routes on the portal are implemented via WFS, I did not find support for this type of map in route-me. But inside the javascript, there were functions that display layers in the standard WMS format, i.e. pictures.

With the browser and sniffer, it also turned out to be easy to figure out how to get a list of stops for a route or in a specific area. It is worth noting that two adjacent stops may have identical coordinates (especially after converting to a Google projection), but different IDs. I haven’t solved this problem yet, there are no standard methods in route-me, it’s necessary to handle the situation of marker overlapping separately.

Organizational issues


Government structures and companies working with them are a nightmare. It is very difficult to explain to the secretaries' secretaries about which portal we are talking about. Not easy to go to the developers. It is impossible to agree on anything with the developers: they constantly change the settings of the site, sometimes in such a way that the program stops working. Apple publishes new versions for about a week ...

By the way, I went to the developers a couple of times in the office, talked to the security men there: the secretaries raised a boom there, deciding that “some hacker had hacked the portal”. I looked at the modules glonass, even pledged. In principle, no one was against my program, but this does not help in any way to solve problems arising after the next security update.

Sales


Sales, of course, are ridiculous, for about two months about 50 applications have been bought. It is curious that with the release of the English version, the amount of sales in foreign stores sometimes exceeds sales in Russian. There is an unpleasant feeling that the work turned out on the table and the development will not pay off. Well, are there many people in St. Petersburg with an iPhone who use public transport and are ready to spend a whole dollar? In a way, of course, rhetorical.

What else to please you?



FXL4M7RJ4XHE
NN9NW7HJHHL3
JXN7FLEYLY7W
TJXW94JH763F
A7M9XMJ94YTK

Source: https://habr.com/ru/post/144086/


All Articles