Skip to content

Map Provider Gotchas

vicchi edited this page Jan 28, 2013 · 9 revisions

ESRI

The ESRI ArcGIS mapping library supports four stylesheet themes; the default for Mapstraction is claro but you can also use themes called tundra, soria or nihilo.

Regardless of which theme you choose, you need to ensure that you ...

  • Include the correct stylesheet
  • Set the HTML body tag to use the CSS class that corresponds to the theme

Theme Stylesheets

  • For claro include http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/claro/claro.css.
  • For tundra include http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/tundra/tundra.css.
  • For soria include http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/soria/soria.css.
  • For nihilo include http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/nihilo/nihilo.css.

Theme Body Class

Each theme also requires that your web page's body uses a style that corresponds to your theme. You can hardcode this into your web page ...

<body class="claro">

.. you can inject this via Javascript ...

<script type="text/javascript">
window.onload = function() {
	document.body.className = 'claro';
};
</script>

... or, if you're using jQuery ...

<script type="text/javascript">
$(document).ready(function() {
	$(document.body).addClass('claro');
});
</script>
Clone this wiki locally