All official European Union website addresses are in the europa.eu domain.
See all EU institutions and bodiesDo something for our planet, print this page only if needed. Even a small action can make an enormous difference when millions of people do it!
If the map service does not have a cache available, use ArcGISDynamicMapServiceLayer. If you don't know whether a service has a cache available, you can use the Services Directory to find out. Notice EEA naming convention. When the map-service contains _Cach_ it means that this service has a tiling schema. _Dyna_ means that the service produces images on the fly. Most of the time both are available. It's obvious that a tiled service will perform better then a dynamic service.
To find more about ESRI API's go to http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm
The ESRI API's can be used freely when your website is not a commercial site.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>ArcGIS JavaScript API: Air/EPRTRDiffuseAir_Dyna_WGS84</title> <link href='/ArcGIS/rest/ESRI.ArcGIS.Rest.css' rel='stylesheet' type='text/css'> <style type="text/css"> @import "http://serverapi.arcgisonline.com/jsapi/arcgis/2.0/js/dojo/dijit/themes/tundra/tundra.css"; html, body { height: 100%; width: 100%; margin: 0; padding: 0; } .tundra .dijitSplitContainer-dijitContentPane, .tundra .dijitBorderContainer-dijitContentPane#navtable { PADDING-BOTTOM: 5px; MARGIN: 0px 0px 3px; PADDING-TOP: 0px; BORDER-BOTTOM: #000 1px solid; BORDER-TOP: #000 1px solid; BACKGROUND-COLOR: #E5EFF7; } .tundra .dijitSplitContainer-dijitContentPane, .tundra .dijitBorderContainer-dijitContentPane#map { overflow:hidden; border:solid 1px black; padding: 0; } #breadcrumbs { PADDING-RIGHT: 0px; PADDING-LEFT: 11px; FONT-SIZE: 0.8em; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 3px; PADDING-TOP: 0px; } #help { PADDING-RIGHT: 11px; PADDING-LEFT: 0px; FONT-SIZE: 0.70em; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 3px; PADDING-TOP: 3px; </style> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis?v=2.0"></script> <script type="text/javascript"> dojo.require("esri.map"); dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.BorderContainer"); var map; function Init() { dojo.style(dojo.byId("map"), { width: dojo.contentBox("map").w + "px", height: (esri.documentBox.h - dojo.contentBox("navTable").h - 40) + "px" }); map = new esri.Map("map"); var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://discomap.eea.europa.eu/ArcGIS/rest/services/Air/EPRTRDiffuseAir_Dyna_WGS84/MapServer"); map.addLayer(layer); var resizeTimer; dojo.connect(map, 'onLoad', function(theMap) { dojo.connect(dijit.byId('map'), 'resize', function() { clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { map.resize(); map.reposition(); }, 500); }); }); } dojo.addOnLoad(Init); </script> </head> <body class="tundra"> <table style="width:100%"> <tr> <td> <table id="navTable" width="100%"> <tbody> <tr valign="top"> <td id="breadcrumbs"> ArcGIS JavaScript API: Air/EPRTRDiffuseAir_Dyna_WGS84 </td> <td align="right" id="help"> Built using the <a href="http://resources.esri.com/arcgisserver/apis/javascript/arcgis">ArcGIS JavaScript API</a> </td> </tr> </tbody> </table> </td> </tr> </table> <div id="map" style="margin:auto;width:97%;border:1px solid #000;"></div> </body> </html>Example was created by Bilbomatica.
For references, please go to https://www.eea.europa.eu/code/gis-archived/esri-api-examples-archived/javascript-example or scan the QR code.
PDF generated on 28 Sep 2023, 09:10 AM
Engineered by: EEA Web Team
Software updated on 26 September 2023 08:13 from version 23.8.18
Software version: EEA Plone KGS 23.9.14
Document Actions
Share with others