Http Hobo

Another blog with web-development tips’n’tricks. | About me

5 posts tagged

my releases

First big update for Mapkeen

Hi,

Since my last post I have been actively working on Mapkeen introducing more cool features. And finally it comes – first big update. If we put it short – now you can add cities and towns onto your map there.

New features:

  • Ability to add visited cities and towns (includes stats)
  • Ability to add cities and towns user lived in (includes stats)
  • New map look
  • Supported highlighting of Australian states
  • Added ability to embed map

Here is an example of embedded map which presents all of the new features:

Hope you are going to love it. Go ahead and start your profiles on Mapkeen right away. And stay tuned for more updated.

Thanks,
George

2019   mapkeen   my releases

Presenting my own project: Mapkeen – travellers network

Hi all,

Although it’s active work in progress, I’m happy to present a project I’ve recently launched – Mapkeen. Before I tell you about the project, couple words about myself.

During the last 4 years, I had an opportunity to travel to different countries. Those were not casual travels, I had to live for several months in a bunch of those. So-called “slow-travelling”. This has quickly became my passion and caused an addiction, however this kind of drug is nothing but good – exploring the world, widening knowledge of different cultures and people. I love this so much, so I wanted to share something with people I’ve been friends or relatives with.

Now let’s turn on some imagination. My family and friends – they all live in different countries on 3 different continents. The more I travel, the more stories, pics and vids I have. Imagine telling those a bunch of times – that won’t be much fun. So I thought – what if I create an application to get all people together and give them an opportunity to share their travel stories?

Here comes Mapkeen. The BIG idea is not yet implemented – I’m still working on it. However, right now you would be able to create a profile and start creating your trip history. Every trip has dates, destinations and you can add a story to it. Thanks to the way this information is gathered, visited destinations get highlighted on your map, also some stats are provided. The more we work, the more interesting the map and stats are to become.

If you share my love and passion for travels, please join Mapkeen. You can either subscribe for news there or follow this blog as new features are to be release soon. The one we currently have been working on is to make map show not only whole countries, but visited regions and cities as well. Also we keep working on making the application more reliable, stable and quick.

If you have ideas, thoughts or any other input, please feel free to share in comments. I will highly appreciate that!

Thanks,
George

2019   mapkeen   my releases

JSON-RPC implementation for Yii2

Hi there!

I’m currently working on a mobile application, and initially I used REST approach for client-server communication. However, it quickly started to drive me nuts as REST has a lot of flaws and in my opinion is not nice at all. In short – because it’s too hard to have transactions for operations. So I decided to move to JSON-RPC protocol. I considered GraphQL (seems a little bit overkill for my current needs), gRPC (you can’t have gRPC server written on PHP, so porting my existing Yii2-based server solution would take too much time), but JSON-RPC is the simplest and quickest way to go.

However, I haven’t found any Yii2 extension for this which I would like. Main thing I didn’t like is that existing extensions don’t use Yii2 power and features. That doesn’t make sense because why not go with standalone JSON-RPC server then?

So I wrote my own extension which translates “method” string to a route and then executes an action. Therefore Yii2 is used as usually, just with different entry point.

Let’s say we have the following controller:

<?php
namespace app\modules\api1\controllers;

class ExampleController extends \yii\web\Controller {

    public function actionTry() {
        return "You've got it!";
    }

    public function actionTryWithParams($foo) {
        return "Params received: \$foo = $foo.";
    }

}

Calls and responses would look like the following:

-> {"jsonrpc": "2.0", "method": "api1.example.try", "id": 1}
<- {"jsonrpc": "2.0", "result": "You've got it!", "id": 1}

-> {"jsonrpc": "2.0", "method": "api1.example.try-with-params", "params": {"foo": "bar"}, "id": 2}
<- {"jsonrpc": "2.0", "result": "Params received: $foo = bar.", "id": 2}

-> {"jsonrpc": "2.0", "method": "api1.example.garbage", "id": 3}
<- {"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found."}, "id": 3}

-> [
	{"jsonrpc": "2.0", "method": "api1.example.try", "id": 1},
   	{"jsonrpc": "2.0", "method": "api1.example.try-with-params", "params": {"foo": "bar"}, "id": 2},
	{"jsonrpc": "2.0", "method": "api1.example.garbage", "id": 3}
   ]
<- [
	{"jsonrpc": "2.0", "result": "You've got it!", "id": 1},
   	{"jsonrpc": "2.0", "result": "Params received: $foo = bar.", "id": 2},
	{"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method not found."}, "id": 3}
   ]

Check it on GitHub or use with Composer (note that it’s only alpha available now as I’m still working on the extension and testing it):

"repositories": [
        {
            "type": "git",
            "url": "https://github.com/georgique/yii2-jsonrpc/"
        }
    ],
    "require": {
        "georgique/world-geojson": "*@dev"
    }
]

P.S.: Couldn’t post extension to official Yii2 site because rules are just insanely stupid there, which I will write another post about.

2018   json-rpc   json-rpc server   my releases   yii2   yii2 extensions

World GeoJson repository release v2.0.0: areas boundaries

I’m happy to announce that second release of my world-geojson repository is finally online. First release was about countries, and countries there included all the areas mentioned above. But in most cases when you say United Kingdom, you don’t think about Montserrat or South Sandwich islands, although they belong to the Crown. That’s what this release is about:

  • countries being associated with or managed by another countries
  • overseas territories
  • regions not being part of a country mainland

Full list of the areas introduced in the release is in the bottom of this post.

I want to mention that it is quite tricky to choose which countries to split to areas, and which not to. So while doing that I used Google Places API to verify if the area is recognized. For example French Polynesia is recognized, so it was separated from France mainland. But if we take a look on Malaysia, we see that it’s split between two major islands. Informally they are called as “West Malaysia” and “East Malaysia”. However, Google Places don’t recognize such a query, so Malaysia remains as is in this release. Finally you might find it handy that all the areas are compatible with Google Places API.

Also second release contains several fixes for the countries boundaries too. Added US Virgin Islands, improved UK boundaries, added Mayotte and Reunion, etc.

Next release would be about countries states. That would be big, as Russia alone has about 90 states, and in addition to that there are US, China, India, Brasil, Indonesia and other countries. Don’t expect next release soon, but it will definitely come one day.

If you want to contribute in any way – advice, fix, additions – welcome to comments.

Full list of areas introduced in release 2.0.0:

  • Denmark (3): Mainland/Greenland/Faroe Islands
  • Ecuador (2): Mainland/Galápagos Islands
  • France (18): Mainland/Corsica/French Guiana/Guadeloupe/Martinique/Mayotte/Réunion/Clipperton Island/French Polynesia/New Caledonia/Saint Barthélemy/Saint Martin/Saint Pierre and Miquelon/Wallis and Futuna/French Southern and Atlantic Lands
  • Italy (3): Mainland/Sardinia/Sicily
  • Netherlands (7): Mainland/Bonaire/Saba/Sint Eustatius/Aruba/Curaçao/Sin Maarten
  • New Zealand (12): Mainland/North Island/South Island/Tokelau/Kermadec Islands/Chatham Islands/Three Kings Islands/Antipodes Islands/Auckland Islands/Bounty Islands/Campbell Island/Snares Islands
  • Norway (3): Mainland/Svalbard/Jan Mayen
  • Portugal (3): Mainland/Azores/Madeira
  • Spain (3): Mailand/Canary Islands/Balearic Islands
  • United Kingdom (21): United Kingdom/England/Scotland/Wales/Northern Ireland/Isle of Man/Guernsey/Jersey/Gibraltar/Akrotiri and Dhekelia/Bermuda/Turks and Caicos Islands/British Virgin Islands/Anguilla/Cayman Islands/Montserrat/Pitcairn Islands/Saint Helena, Ascension and Tristan de Cunha/British Indian Ocean Territory/Falkland Islands/South Georgia and the South Sandwich Islands
  • USA (17): Mainland (to be splitted to states)/Palmyra Atoll/Guam/Northern Mariana Islands/Puerto Rico/United States Virgin Islands/American Samoa/Baker Island/Howland Island/Jarvis Island/Johnston Atoll/Kingman Reef/Wake Island/Midway Atoll/Navassa Island/Serranilla Bank/Bajo Nuevo Bank
2017   my releases   world-geojson

World GeoJson repository release v1.0.0: countries boundaries

I am proud to announce first release of World GeoJson repository. It contains all the countries boundaries with the best quality available for commercial use so far.

Example of quality. Other repositories do not care about small islands so much, I do.

You can download it from GitHub or use as a Composer package:

"repositories": [
        {
            "type": "git",
            "url": "https://github.com/georgique/world-geojson/"
        }
    ],
    "require": {
        "georgique/world-geojson": "1.*"
    }

This data was created manually using http://geojson.io tool, which uses Mapbox, OCM and OSM maps. So the data would be perfectly displayed on these maps, but it has some minor incompatibilities with Google Maps: northern areas and some tiny islands. I’m going to keep working on these issues and get them fixed.

Next release would be about areas boundaries. Some countries have external territories, e. g. Denmark besides the mainland has Greenland and Faroe Islands. I’m going to split them. Date of the next release is not known yet.

Happy using!

2017   my releases   world-geojson