Quick start


GISFile JavaScript API - is a set of JavaScript-components, which allows you to place on the site pages interactive maps. To make insert the card on a Web page, follow the steps below.

Step 1. Connect API

Before you use the functions API, need to insert JavaScript-file.
To do this add in the body "body" HTML-page string the following species:

<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>

By address http://gisfile.com/api/1.0/ is located JavaScript loader which is accessed to connect the necessary JavaScript API components.

Step 2. Fill in the map display options

In the src string to load JavaScript, please fill out the parameters of the map display: lat=50.450 - latitude, lon=30.524 - Longitude, z=11 - zoom, width=100% - the width of the container map, height=300 - the height of the container.


Council. A unique identifier (id) of the container also be used, but in this case it is necessary JavaScript-file with the id parameter to insert into a block head, and in the body "body" to insert the container.
<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>
Step 3. Add the mark on the map

Display the mark, you can using the parameter icon. Value icon=gisfile-blue allows you to specify name of icons for the mark. In order to when you press mouse button on the mark, additional information is displayed, you can fill in the parameters name and / or note. To display the layer use the parameter layer=name of the layer, to display the map map=name of map.


Council. If you use the сyrillic text in the parameter name or note, for correct display, encoding Web pages must be UTF-8. At different encoding text or text with elements Html use the parameters xname or xnote in Hex format.

The result

The full text of the example:

<html>
<head>
    <title>Quick start. Placing an interactive map on the page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <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&width=100%&height=300" type="text/javascript" charset="utf-8"></script>
</body>
</html>
It has not turned?

If you are working with the JavaScript API and you have additional questions, please look by links an additional information or send us your question by means the feedback form.