Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Normalize geographic center coordinates in esriMap module #93

Closed
jwasilgeo opened this issue Sep 13, 2015 · 4 comments
Closed

Normalize geographic center coordinates in esriMap module #93

jwasilgeo opened this issue Sep 13, 2015 · 4 comments
Assignees
Milestone

Comments

@jwasilgeo
Copy link
Contributor

I propose that the esriMap module updateScopeFromMap function normalize the geographic center coordinates. Consider the screenshot below, where the longitude is greater/smaller than +/-180 after panning west from the initial map extent over CA.

image

The change could be:

...
if (geoCenter) {
    geoCenter = geoCenter.normalize();
    scope.center = {
    ...

Thoughts?

@jwasilgeo jwasilgeo self-assigned this Sep 13, 2015
@tomwayson
Copy link
Member

uh, yeah, that looks bad! I didn't even know normalize() was a thing. I'd say let's do it.

@jwasilgeo
Copy link
Contributor Author

Cool. I can verify that it's a quick fix for the sake of the geographic extent center values; no problem with normalizing a point.

On a related note--I just couldn't let it go (typical)--I looked at the esriMap extent values. The xmin and xmax values also continue to increase or decrease in a similar manner. Do we want to fuss over this?

Normalizing an extent will do the job, but if it crosses the dateline, we get 2 normalized extents. Then again, since this only applies when an extent-change handler has been bound and we provide the entire event object, we could continue to leave the onus on the developer to deal with normalizing if they really wanted to...

@tomwayson
Copy link
Member

Hm.. good question. For extent, I tend to think that the onus should be on the developer.

@tomwayson tomwayson modified the milestone: Beta 5 Sep 15, 2015
@jwasilgeo
Copy link
Contributor Author

Alright, agreed. Thanks for the feedback, I needed a sanity check on that one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants