RMK map service

RMK map service provides layer for the areas in the ownership of the RMK.
Services base urls:

riigimets

Using with Bing map

Most convenient way to use RMK map service in Bing map, is via REST api which provides 256x256 px tile images based on quadkey.
Uri format is /api/bing/{quadkey}
You can read about the quadkey from http://msdn.microsoft.com/en-us/library/bb259689.aspx

Example:

    <div id="map-canvas" style="width: 100%; height: 100%; position: absolute; top: 0px;"></div>
    <script charset="UTF-8" type="text/javascript" 
        src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=et-EE"></script>
    <script type="text/javascript">
        var data = {
            credentials: "YOUR_BING_KEY",
            center: new Microsoft.Maps.Location(58.614000244140625, 25.253000259399414),
            mapTypeId: Microsoft.Maps.MapTypeId.ROADMAP,
            zoom: 8,
            enableSearchLogo: false,
            showDashboard: false
        };
        var map = new Microsoft.Maps.Map(document.getElementById("map-canvas"), data);
        var tileSource = new Microsoft.Maps.TileSource({ uriConstructor: '/api/Bing/{quadkey}' });
        // Construct the layer using the tile source
        var tilelayer = new Microsoft.Maps.TileLayer({ mercator: tileSource, opacity: 0.5 });
        // Push the tile layer to the map
        map.entities.push(tilelayer);
    </script>
Demo

Using with Google map

Most convenient way to use RMK map service in Google map, is via REST api which provides 256x256 px tile images based on zoom level and tile xy coordinates.
Uri format is /api/google/{zoom}/{tileX}/{tileY}
You can read about the google tile coordinates from https://developers.google.com/maps/documentation/javascript/maptypes#TileCoordinates

Example:

    <div id="map-canvas" style="width: 100%; height: 100%; position: absolute; top: 0px;"></div>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
        var maptiler = new google.maps.ImageMapType({
            getTileUrl: function (coord, zoom) {
                return "/api/google/" + zoom + "/" + coord.x + "/" + coord.y;
            },
            tileSize: new google.maps.Size(256, 256),
            isPng: true,
            opacity: 0.5
        });
        var map;
        function initialize() {
            map = new google.maps.Map(document.getElementById("map-canvas"));
            map.setCenter(new google.maps.LatLng(58.614000244140625, 25.253000259399414));
            map.setZoom(8);
            map.setMapTypeId('satellite');
            map.overlayMapTypes.insertAt(0, maptiler);
            map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
        }
        google.maps.event.addDomListener(window, 'load', initialize);
      </script>
Demo

Layers

Default layer is Rmk. To get custom layers, add layers parameter to querystring

        '/api/Bing/{quadkey}?layers=1&layers=2'

NB! layers are rendered in the same order as they are defined in querystring


BrightSpark OÜ
brightspark.ee
info@brightspark.ee