Coding Period - Weekly Report 1
What a great idea it was to start early. That’s the first lesson learnt. Since the last month, I had been busy setting up the development environment for IIAB Maps, but I used to get stuck at some point or the other. I’ve lost count of how many VMs have I started and destroyed. Indeed, a part of it was frustrating, but had it not been that way, I wouldn’t have learnt sooo much about the ins and outs of my project
So this week started on 2nd June(Tues) with my usual weekly conference call with my mentors. It’s actually a great way to discuss all the progress you’re making and discuss if you’re going in the right direction.We discussed the shortcomings of the previous approach we were using and what we should change. Actually, the three of us were working on three different development environments. So that needed to change. So we decided on the upstream, origin and the local environments for ourselves.
Once the basics were sorted, it was time for the actual work. The following targets were to be met for the upcoming week :
Write install scripts for installing IIAB Maps viewable on any platform:
IIAB Maps uses the OpenLayers library for rendering maps on the client side. Hence, one of the first packages to be installed was Openlayers. Openlayers itself is a huge package and getting it installed correctly required us to have some kind of a JS bundler. We finalised on Webpack after having a lot of discussion over Parcel vs. Webpack. Despite the simplicity which Parcel offers, and zero configuration requirements offered by Parcel, we decided for Webpack since it looked a lot more adaptable to our project. With the previous project available, I had a package.json available at my disposal, but the packages were quite outdated. So to update the packages,we used another npm package called npm-check-updates. ncu is a nifty little package that checks all the available packages in your package.json file and updates them to the recent versions. So the following few lines made sure were my package.json was fresh as new!
$ npm install -g npm-check-updates //install ncu globally
$ ncu //lists the table of outdated packages
$ ncu -u //This updates the packages
$ npm install // install the updated packages
Overlays on Maps
With Openlayers installed, it was time for displaying the overlays on the maps. For this we needed a GeoJSON file with the coordinates of marked places, that can be put on the map as markers. According to Wikipedia,
These GeoJSON files are the central element of my project. These are generated from a Wikidata query generated through the WikiData Query Service. WQS uses SPARQL which can be used to query through any document or data on the Wikidata service.
Once the GeoJSON files were procured, it was only a matter of displaying them on the maps. Here comes the difficult part. OpenLayers as the name says used layers to display components of a map. These layers must be in the correct order to be rendered properly. Hence, in my case, the satellite map tiles needed to go first, then the OSM locational tiles and then the overlays. This was ensured by calling the function for the overlays after all the layers were rendered. This was a challenge initially, because the static tiles were rendered through a php-based tile-server that rendered the tiles. This step took a while,but was finally complete.
Running tests and finalizing the Pull Request
As Tim said, every PR must undergo at least the following tests :
- Smoke Test
- Functional Test
While these were completed, my week 1 came to a close, and I will now be having my week-end Video Call with my mentors to discuss the progress and the next goals.