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

Allow specifying the map's initial maxBounds in a different gcs. #794

Merged
merged 1 commit into from
Mar 21, 2018

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Mar 9, 2018

If the bounds are known in a gcs other than the interface gcs, they had to be converted first.

This change makes it easier to initialize a map with a stereographic projection, where the unitsPerPixel can be specified to determine the scope of the area shown (since it could be infinite). For example,

var gcs = '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs'
var unitsPerPixel = 10000
geo.map({
  gcs: gcs, 
  maxBounds: {
    left: -unitsPerPixel * 128, 
    right: unitsPerPixel * 128,
    bottom: -unitsPerPixel * 128,
    top: unitsPerPixel * 128,
    gcs: gcs
  },
   unitsPerPixel: unitsPerPixel
});

@manthey manthey changed the base branch from chrome-65-testing to master March 14, 2018 19:45
If the bounds are known in a gcs other than the interface gcs, they had
to be converted first.

This change makes it easier to initialize a map with a stereographic
projection, where the unitsPerPixel can be specified to determine the
scope of the area shown (since it could be infinite).  For example,

var gcs = '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0
+y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs'; var unitsPerPixel =
10000; geo.map({gcs: gcs, maxBounds: {left: -unitsPerPixel * 128, right:
unitsPerPixel * 128, bottom: -unitsPerPixel * 128, top: unitsPerPixel
* 128, gcs: gcs}, unitsPerPixel: unitsPerPixel });
@manthey manthey force-pushed the map-maxbounds-gcs branch from 2b4d2dc to 8d39981 Compare March 15, 2018 12:38
@manthey manthey merged commit 213a0c3 into master Mar 21, 2018
@manthey manthey deleted the map-maxbounds-gcs branch March 21, 2018 17:41
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

Successfully merging this pull request may close these issues.

2 participants