Development has quickly progressed through two weeks, and it’s time to write a bi-weekly report.
Project Progress
The project is still in its early development stage, so we are unable to provide a usable prototype at this time.However, our implementation of the rendering part has been basically determined.
After testing, points and paths can be rendered successfully.
Due to the ongoing development of the interfaces for other modules, some functions have not yet been implemented. For instance, highlighting segments of a path instead of selecting the entire path as in the default logic of the iD editor. Also, the rendering of polygons has not been implemented yet because it requires the interface of the editing module.
We plan to divide the project into different components to facilitate future development and maintenance.
Demonstration Effect
At present, our code cannot perform any editing operations, nor can it directly render XML or JSON obtained from the OSM website. Therefore, I manually constructed a few points as a very rudimentary rendering test. The background tiles function was also tested, and it is currently running well.Please forgive the poor color scheme; I will polish it later. Since the selected latitude and longitude happen to have no roads (which is not surprising, as 71% of the Earth is ocean, and most of the land is uninhabited, and I unfortunately picked a random latitude and longitude), this point have no recognizable OSM data.
But at least, the tiles can indeed be requested and rendered normally, as requests can be seen in developer tools from the screenshot.
Additionally, we encountered a minor technical issue while trying to add a custom User-Agent for all tile requests to comply with OSMF’s Tile Usage policy. Specifically, we wanted to customize the request headers (for example, inserting information like Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 BusFensi/0.0.1 into the User-Agent, instead of using the browser’s default User-Agent). We needed to make some modifications to pixi.js because it appears that pixi.js loads images through the <img> tag. However, doing so does not adhere to good development practices. Therefore, based on @bhousel’s suggestion, we decided to abandon this relatively unimportant requirement.
Maintance Roadmap
In the next two weeks, the development of the editing module will be carried out, and a well-functioning prototype will be created for polishing. Once stabilized, the module will be able to communicate with APIs that comply with OSM standards and submit results. Hope I won’t get blacklisted for writing malicious bugs, XD.
Currently, the state management module is being written to provide stable support for editing.
- Author: fltb
- Date: 2024-07-14
Published by OSMChina (with the help of Tsinghua University TUNA Association and special thanks for their valuable assistance and support.)
Original report (in Chinese) can be seen at https://fltb.github.io/zh-cn/weekly-post-busfensi-1/2024-07-18 under CC BY-NC-SA 4.0.