I have an ArcGIS JavaScript application which displays one single FeatureLayer on a map which is in a Dojo BorderContainer/ContentPane template similar to the one shown here. I am trying to initialize the map to the fullExtent of the single FeatureLayer. I accomplish this like so:
map.on("layers-add-result", function(evt){
map.setExtent(evt.layers[0].layer.fullExtent)
});
However, I am finding that points on the extremes of the map are cut off. Specifically, this is a layer of points across the eastern and midwestern United States, but there are a few points in California and one in France. The points in CA and France are out of the map's extent.
My hunch was that the extent is set assuming there is no ContentPane side panel, then forced into the smaller viewpoint once the ContentPane is rendered. I tested this theory by creating a map which spans 100% of the page's width. Sure enough, the problem went away.
How can I ensure that map.setExtent() takes into account the ContentPane side panels? I'm already requiring domReady! and calling parser.parse(). Anything else I'm missing?
Aucun commentaire:
Enregistrer un commentaire