Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map extent across 180th meridian #6

Open
asizer opened this issue Aug 8, 2015 · 0 comments
Open

Map extent across 180th meridian #6

asizer opened this issue Aug 8, 2015 · 0 comments

Comments

@asizer
Copy link

asizer commented Aug 8, 2015

Sorry, this might not be the right place for this issue, since the error isn't in this github repo or the live version linked to here. But it is in the hosted ArcGIS Online version of the Summary Viewer as of early August 2015.

If the current extent of the map includes the 180th meridian, the extent used for the statistics wraps horizontally around the entire world.

Steps to reproduce:

  1. Open the live example from the ArcGIS Online gallery of the Summary Viewer
  2. Navigate to an extent that includes the 180th meridian but doesn't include any features (the string of atolls to the northwest of Hawaii is a good landmark)
  3. Note the summary statistics aren't 0

I'm not sure the implications of changing the main.js > summarizeFeatures() function back to its state in this repo, but the new normExts in the summarizeFeatures function as seen in the hosted version of main.js seems to be what's causing problems.

If you add a graphic to the map in that function to symbolize the normalized extent used, you'll see it start at the 180th meridian and extend around the world.

// existing code in hosted version
if (normExts.length > 0) {
  ext = normExts[0];
  for (var j=1; j<normExts.length; j++) {
     ext = ext.union(normExts[j]);
  }
  // new code to symbolize one of the problematic extents
  if (normExts.length > 1 && !this.map.graphics.graphics.length) {
    var sym = new esri.symbol.SimpleFillSymbol();
    sym.outline.setColor('red');
    var gr = new Graphic(ext, sym);
    this.map.graphics.add(gr);
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant