Select to view content in your preferred language

Map offset in JSAPI - chrome/ff only

1033
3
Jump to solution
10-13-2014 03:08 PM
TerryGiles
Occasional Contributor III

We have an app with 2 maps on it.  The maps start with only a basemap and some graphics visible.  On the 2nd map, the map (basemap tiles and graphics) seem to be offset by almost 50% of the <div> containing the map as shown in the attached image (map_chrome).  Notice the info window also doesn't align with the graphic.  If I were to pan the map to the west, the graphic would also disappear.  But this only happens in Firefox and Chrome.  In IE 10 (haven't tried 11) it works fine (other attached image).  The only other time I've seen weirdness like this is if you don't set the class on the body tag to one of the Dojo class names. But we're setting it in code so I don't think that's it.  The base map and all graphics work just fine on the other map on the page too.

Any ideas what to check?  This one has me stumped!

Thank you,

Terry

0 Kudos
1 Solution

Accepted Solutions
JonathanUihlein
Esri Regular Contributor

Hi Terry,


This looks like a CSS issue.

Can you recreate a bare-bones version of your application using jsfiddle so I can take a look?

Thanks!

View solution in original post

0 Kudos
3 Replies
Vara_PrasadM_S
Occasional Contributor II

Hi Terry,

Have you tried calling "reposition()" / "resize(immediate?)"‌ functions on Map object in map - load event.

Thanks & Regards,

Vara Prasad.

0 Kudos
JonathanUihlein
Esri Regular Contributor

Hi Terry,


This looks like a CSS issue.

Can you recreate a bare-bones version of your application using jsfiddle so I can take a look?

Thanks!

0 Kudos
TerryGiles
Occasional Contributor III

Jonathan is correct, it was a CSS issue.  A parent DIV tag belongs to a class with 'text-align:center' set; removing this solves the issue of the map (it was centering as the inherited CSS told it to)

0 Kudos