Back to Home

API 2GIS updates: static maps, redesigned marker and balloon, documentation and speed improvements

You may have already heard about the 2GIS API · but even if not · it doesn’t matter. Indeed · in this post we will consider all API updates over the past couple of months. Static Maps API Let's start with ...

API 2GIS updates: static maps, redesigned marker and balloon, documentation and speed improvements

    You may have already heard about the 2GIS API, but even if not, it doesn’t matter. Indeed, in this post we will consider all API updates over the past couple of months.



    Static Maps API

    Let's start with the recently launched Static Maps API. It allows you to place on your web pages a static image from 2GIS maps, without the need to use JavaScript. This is done through an http request, in response to which an image with a map fragment and other elements specified by the request comes.

    The main area of ​​application of the Static Maps API we see as mobile websites. For example, the mobile version of our Flamp review service already uses the Static Maps API. And now you can add an image with a map to your site! Like this one:

    image

    New features and improved map usability

    We have significantly redesigned the most popular parts of the API - markers and baluns . If you don’t understand what we’re talking about, we’ll explain: markers are the same thing (usually orange) that indicates a particular object on the map. A balun is what appears when you click on a marker, a bubble with text (as in comics).

    And this is what has changed. The balloon appeared: a method of resizing, the ability to drag and drop, a method for forced redrawing. For markers: methods for moving, the ability to dynamically change the icon, the ability to set the scope for the click handler. The new DG.Markers.MarkerWithBalloon class implements a marker to a balloon bundle.

    Performance and resiliency also improved

    One of the most important tricks in the development of the reference API for us is fast and stable operation. In February and March, we significantly improved these important technical indicators. So, uptime exceeded 99.9. And search methods began to work even faster - now even the most "heavy" queries are performed on average within 200 ms. Company card requests - 50 ms.

    New organizations every day

    We already had a couple of publications on this topic, but you can repeat it here - the 2GIS API is switching to a daily update. At the moment, this applies to Novosibirsk , Moscow and Yekaterinburg , but will gradually spread to other cities.

    2GIS Online switched to the public version of the API

    If before 2GIS Online went ahead of the public API and could contain any features that were not available to partners, now they are equal in status. From now on, 2GIS Online runs on the public 2GIS API, in fact being a standard partner of the map API and transport API (it switched to the directory API earlier). Therefore, almost everything that you see in 2GIS Online can be recreated on your resource as part of an affiliate program. And if you do not know how to do this, and the documentation does not help, then do not be shy - write to us at [email protected] and they will certainly help you. By the way, we continue to collect preliminary applications for the transport API, which will appear soon.

    Even our site did not escape the update.

    In particular, the “Solutions” page was supplemented with new examples, the “Features and Benefits” page became more beautiful, and the first examples appeared in the documentation for API maps (there will be more of them soon). And for the reference API, recommendations for the design of reference sections . Oh yes - if you haven’t found something, we will be glad to add it. Write to us if, in your opinion, there are not enough examples of the implementation of something specific. And if you have your own example, which you are ready to share, we will be happy to add it to the site.

    You can find out more details about the 2GIS API here: api.2gis.ru

    Read Next