Skip to content

Map extent across 180th meridian #6

@asizer

Description

@asizer

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);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions