ArcGIS API
JAVASCRIPT
In the Javascript API, the MDS Foundation Map is referenced like any other Tiled Map Service. The example below shows the simplest case of using the Foundation Map as a base map layer in a JavaScript application.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<mets http-equiv="X-UA-Compatible" content="IE=7"/>
<!-- The viewport meta tag is used to improve the presentation and behavior of the samples on ios devices -->
<meta name="viewport" content="intial-scale=1, maximum-scale=1, user-scalable=no" />
<title>Create Map</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.1/js/dojo/dijit/themes/claro/claro.css">
<script type="text/javasctipt" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1"></script>
<script type="text/javasctipt">
dojo.require("esri.map");
function init(){
var map = new esri.Map("map");
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("<!-- Insert Url Here -->");
map.addLayer(tiledMapServiceLayer);
}
dojo.addOnLoad(init);
</script>
</head>
<body class="claro">
<div id="map" style="width: 900px; height:600px; border 1px solid #000;"></div>
</body>
</html> The Esri JavaScript API does also support a special case whereby multiple URLs for tile sources can be specified in the constructor for the TiledMapServiceLayer class. These are specified in the tile servers array that can be passed as part of the options parameter in the constructor. Full details can be found in the API documentation.
FLEX
In the Flex API, the MDS Foundation Map is referenced like any other Tiled Map Service. The example below shows the simplest case of using the Foundation Map as a base map layer in a Flex application.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:esri="http://www.esri.com/2008/ags"
pageTitle="A tiled map service">
<esri:Map>
<esri:ArcGISTIledMapServiceLayer url="<!-- Insert Url Here -->"/>
</esri:Map>
</s:Application>
SILVERLIGHT
In the Silverlight/WPF API, the MDS Foundation Map is referenced like any other Tiled Map Service. The example below shows the simplest case of using the Foundation Map as a base map layer in a Silverlight mapping application.
<UserControl x:Class="ArcGISSilverlightSDK.Map"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<Grid x:Name="LayourRoot">
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer ID="FoundationMap"
Url="<!-- Insert Url Here -->"
</esri:Map>
</Grid>
</UserControl>
OPENLAYERS
OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds. OpenLayers is completely free, Open Source JavaScript
Integrating MDS Foundation Map using OpenLayers JavaScript source is outlined below:
<!DOCTYPE html>
<html dir="ltr" lang="en-AU">
<head>
<meta charset="UTF-8" />
<title>Simple Example of MDSFoundationMap with OpenLayers</title>
<script type="text/javascript" src="/Portals/2/OpenLayers.js"></script>
<link rel="stylesheet" href="./css/layout.css" type="text/css" />
<script type="text/javascript">
function init() {
var map, layer, centre;
var MapDS = {
ApiKey: 'YOUR_API_KEY_HERE'
};
OpenLayers.Util.onImageLoadError = function() { this.style.display="none"; }
map = new OpenLayers.Map( 'map', {
controls: [
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.Attribution()
]
}
);
layer = new OpenLayers.Layer.XYZ( "MDSFoundationMap", [
'http://t1.nowwhere.com.au/1/${z}/${x}/${y}?key='+MapDS.ApiKey,
'http://t2.nowwhere.com.au/1/${z}/${x}/${y}?key='+MapDS.ApiKey,
'http://t3.nowwhere.com.au/1/${z}/${x}/${y}?key='+MapDS.ApiKey,
'http://t4.nowwhere.com.au/1/${z}/${x}/${y}?key='+MapDS.ApiKey
], {
transitionEffect: "resize",
buffer:0,
sphericalMercator: true,
projection: new OpenLayers.Projection ("EPSG:3857"),
attribution: "<a href=\"http://www.mapds.com\"><img src=\"http://apps.nowwhere.com.au/MDSQuickMap/img/MDSLogo.png\"></a> <a href=\"http://www.nowwhere.com.au/lic/NowWhereLic.htm\">© 1998 - 2011</a>"
}
);
map.addLayer(layer);
// set transformation functions from/to alias projection
OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.SphericalMercator.projectForward);
OpenLayers.Projection.addTransform("EPSG:3857", "EPSG:4326", OpenLayers.Layer.SphericalMercator.projectInverse);
centre = new OpenLayers.LonLat( 151, -33 );
map.setCenter( centre.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), 5 );
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body></html>