Визиком карты

Migrating from 1.0.0. version

Loading map
  • The map initialization code need to produce in the createVisicomMap () function. You should independently determine this function (see example).
  • Class VMapEngine replaced by VMap.
Coordinates
  • Classes VPoint and VGeoPoint were removed from the engine. The system works only with geographical coordinates.
  • The coordinates for all objects are transferred by structure {lng: 30.5112, lat: 50.4550}; (see examples).
If your database is stored the local coordinates, they must be recalculated to the geographical coordinates. It's carried out in two ways:
  • By using XMLAPI 1.0.1
    You must use the loc2geo method (see documentation)
  • By using Maps API 1.0.0
    You must use the VPoint.convertToGeoPoint() function (see documentation)
Zoom levels
  • The zoom levels have changed slightly since change the projection of the map display. But for the ukraine_ru (ua, en) database remained the same 12 zoom levels.
    If you want to use the 18 zoom levels of the world you necessary to use the map world_ru (ua, en). At the moment maps is only for the Ukraine and Belorussia.
Adding/removing objects
  • From the VMap and VLayer classes are removed by addMarker() and addPolyline() methods, etc.
    Adding and deleting any object can be perform by add(obj) and remove(obj) functions.
Working with events
  • Instead the VEvents object you must use appropriate methods of classes VMap, VMarker (see example).
Markers
  • Using the marker has not significantly changed, but there are some features. To open the information window you must execute the following code:

    // the information window should already be set for the marker
    marker.info(),visible(true);
    map.repaint();

    Hiding:
    marker.info(),visible(false);
    map.repaint();
  • Also, information windows are simple objects, they can be added on the map without marker.

    var info = new VInfoWindow({lng: ..., lat: ...}, "Текст");
    map.add(info);
    map.repaint();

    If you add the information window by this example, it will always be displayed on the screen
    Some behavior can be programmed using options (see description).
Graphics
  • The VPolyline and VPolygone classes replaced by the VLine and VArea Using these classes has not significantly changed.
    Parameters:

    <html xmlns:v= "urn:schemas-microsoft-com:vml">

    and the styles block

    v\:* { behavior: url(#default#VML) }
    are added automatically.
Calculation of the route and remote services
  • These services are available only to registered users (see description).
  • In the new API version the calculation of the route available as supplement to the engine.
    To do this, connect the JavaScript file from our server (see. description).
  • To calculate the route use the method of class VRemoteCall.request().
    All requests are considered as requests to XMLAPI method getRoute.
Others changes in the classes and methods
  • VBounds. Instead, use VRect
  • VMapEngine.resizeViewport(). Use method VMap.repaint(). This also checks the size of the map window.