harrygibson

Problem with CSS style of images in Dynamic map layer

Discussion created by harrygibson on Jan 27, 2012
Hi,

I've come across a strange problem with the Javascript API when I've tried to embed a (very simple) map into a page of our organisation's main website. The map has two tiled layers and a dynamic service layer. The dynamic service layer is displaying offset by a few pixels from the map's div - it doesn't extend right to the top and left sides, and where it does end it is showing a border.

I've finally traced this up to one of the stylesheets that we are supposed to apply as part of the in-house website style. Unfortunately, this defines the CSS img class as having a border and margin, i.e.
img { border: 1px solid black; margin: 3px;}


Looking at the images created by the tiled map service layers, these have an applied class of .layerTile. This is defined in the ESRI JSAPI stylesheet as
.map .container .layersDiv .layerTile { position:absolute; border:none; margin:0px; padding:0px; }

so it overrides the img style and displays fine. But the images created by the dynamic map service layer don't seem to have any such class applied that I can hook into to override the default img style.

Two questions
- is this a bug or intended behaviour, for the dynamic layers not to have an identifying class applied to their images?
- what would be the best way for me to override it, short of getting rid of the annoying IMG selector in the top-level style sheet?

Thanks,
Harry

Outcomes