General information


GISFile JavaScript API is a set of JavaScript-components intended to view interactive maps on web pages and applications. API components are implemented as classes, functions, static objects and interfaces. JavaScript API are available for use immediately after loading.

Connection API

Connection API is produced by loading external JavaScript-file containing components API. Loading JavaScript-file and provide a container for the map display can be performed automatically, if the JavaScript code to insert into the body of the document. Containers ID is created automatically if it is not specified in the string src.

<body>
    ...
    <script src="http://gisfile.com/api/1.0/?lat=50.450&lon=30.524&z=11&width=100%&height=300" type="text/javascript" charset="utf-8"></script>
    ...
</body>

At presence in document prepared by the container loading JavaScript-file can be placed in the unit head document Html.

<head>
    ...
    <script src="http://gisfile.com/api/1.0/?icon=gisfile&name=Kiev&note=The capital of Ukraine&lat=50.450&lon=30.524&z=16&id=map" type="text/javascript" charset="utf-8"></script>
    ...
</head>
<body>
    ...
    <div id="map" style="width: 100%; height: 300px"></div>
    ...
</body>

Map

The main component of the API is a map that can be placed in any HTML-element and has a rectangular forme. Parameters maps are display of area, view maps and displaying. When creating a map can specify the display parameters (center of the map and scale of). If they do not specify the mapping is performed by map objects. When JavaScript is located in the body of the document, must specify width and height height, to automatically create containers map.

<script src="http://gisfile.com/api/1.0/?map=usa&lat=38.54817&lon=-97.47070&z=4&width=100%&height=300" type="text/javascript" charset="utf-8"></script>

API provides the ability to display three view of maps: mark (icon), layer (layer) and the project (map). Layer and the project has a subtype displaying (type): objects (Overlay) and tiles (TileLayer and TileImage). Container map may contain one or several superimposed on each other layers. There is the possibility of combined displaying of its own and connected layers or of the project map. More complex combinations of displaying are implemented using GISFile API, JavaScript and libraries LeafLet. If when creating a map type is not specified, then displays a map with the base layer.

<script src="http://gisfile.com/api/1.0/?lat=48.54571&lon=31.20117&z=5&width=100%&height=300" type="text/javascript" charset="utf-8"></script>

The project of map depicts the related parameters the map display and layers. To display a project of the map is necessary to specify the parameter map=, where - name the project of map. When displaying tiles project of map, must specify parameters tile.

Map the default responsive to actions performed by the user. For example, on the movement mouse cursor in the display, scrolling, while pressing left button on an object displays the information window.

Layer

Displaying one layer on the map is most often used to display a set of marks (points). The format icons for marks can be set using the parameter icon=, - the name of the icon (examples: icon-red, icon-red.png or http://gisfile.com/css/icons/icon-red.png)

<script src="http://gisfile.com/api/1.0/?layer=shelter&icon=icon-red&lat=48.52934&lon=32.24693&z=11&width=100%&height=500" type="text/javascript" charset="utf-8"></script>

To use the algorithm MarkerCluster grouping marks, necessary add a parameter marker.

<script src="http://gisfile.com/api/1.0/?layer=spcities&marker&width=100%&height=500" type="text/javascript" charset="utf-8"></script>

Objects

On the map can be placed any number of layers with geoobjects and/or just geoobjects, which describe geographical objects. Geoobjects characterized by the presence of geometry, which is determined by the type (point, line, polygon, etc.), coordinates of the geographic object and its attributes (parameters).

To display mark could use the parameters icon=, - the name of the icon (examples: icon-red, icon-red.png or http://gisfile.com/css/icons/icon-red.png). By default, if the name of the icon is not specified, displays the standard icon.

<script src="http://gisfile.com/api/1.0/?icon=icon-olive&lat=50.450&lon=30.524&z=10&width=100%&height=500" type="text/javascript" charset="utf-8"></script>

Coordinates

The basic coordinate system JavaScript API to display the base layers and tiles is the global pixel coordinate system. In this system, each point in the real world is projected onto the endless plane of pixel. On the initial (zeroth) scale map of the world falls in the region of 256x256 pixels. When increasing the zoom level on 1 size "world map" doubles.

Any coordinate system is realized by means of projection. Projection establishes a correspondence between geographic coordinates of the point and the global pixel coordinates for each the scaling factor. For geographic coordinates, by default, API uses the elliptical projection of the WGS-84.

Format downloadable coordinates corresponds to the specification GeoJSON. Detailed information about the components of the opened JavaScript libraries Leaflet.