Eniro jsmapapi

Reference

Reference documentation

Examples

API Loading

The api is loaded using a simple <script> tag inserted in your page. The api code should always be loaded from Eniro’s servers (attempts to download and host the files locally are likely to break with future updates). The simplest loading looks like this:

        <script type="text/javascript" src="http://kartor.eniro.se/rs/eniro.js?partnerId=[your id]"></script>
        
This would load the swedish localised version of the api. There are a couple of request parameters that affect loading.

Partner Id

To help us keep track of who is using the javascript map api we want you to provide an identifier when loading the code*. Each example loads the api code from our servers using a URL like:

           http://kartor.eniro.se/rs/eniro.js?partnerId=[your id]
           
The partnerId will be provided by the maps team at Eniro. For example, if your company name is Nuts 4 Squirrels, your assigned id could be something like nuts4squirrels and the the whole script tag from the api code examples should be changed to:
           <script type="text/javascript" src="http://kartor.eniro.se/rs/eniro.js?partnerId=nuts4squirrels" target="enirojsmapapi"></script>
           
* Use of the api without a proper partnerId is not allowed, and we may, without prior notice, block such access.

About Coordinates

A user of the API will interact using WGS84. (EPSG:4326). The API does internally use other Spatial Reference Systems (SRS), notably Spherical Mercator (EPSG:900913 or EPSG:3857), however as an API user these are rarely of any concern.

In WGS84 parlance one often talk about "lat-long", i.e. a latitude/longitude. In this API, the class eniro.maps.LatLng, is always a WGS84 type coordinate. Notice that LatLng inherits eniro.maps.Coordinate, and in many cases the following two ways of constructing a coordinate are roughly equivalent:

        var coord1 = new eniro.maps.LatLng(10.0, 20.0); // convention for lat/lng is y, x.
        
        var coord2 = new eniro.maps.Coordinate(20.0, 10.0, eniro.maps.Srs.WGS84);

We think of a Coordinate as being an SRS typed Point and LatLng as a coordinate with the specific WGS84 SRS type.

QR