-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
OverviewMap control #2769
OverviewMap control #2769
Conversation
The button structure of ol3 is now used for the overviewmap control. I "borrow" lots of css from the attribution control (i.e.: copy). |
ol3 currently does not have a method to get the map 4 corners, which is different from a view extent (if I understood correctly). This seem to be one of the topic of #2735. I'll wait for #2735 to be completed. BTW, the overview map no longer assumes the map has a view. It doesn't do anything if it doesn't have one. Please, correct me if I'm wrong. |
I think the overviewmap control would be ready 'as-is'. What's remaining to do could be marked in separate issues. The control could use some tests, but I'd like to have it reviewed first. The tests could also be done after. Thanks |
} | ||
.ol-overviewmap-box { | ||
border: 2px dotted rgba(0,60,136,0.7); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"No new line at end of file"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Thanks @adube. I'm done reviewing for today. I'd like to look more closely at how the map and the overview map are synchronized and when the rendering of the overview map occurs. |
@elemoine thank you ! I should be able to complete all fixes you mentioned by tomorrow. |
Leaving #2735 out of this, let's discuss how the overview map should show the main map extent with rotation (and potentially with tilt). Making it so the overview map is fully synchronized with the main map would be facilitated by animating the view (see https://github.com/tschaub/ol3/tree/animated-view). |
If you want to demonstrate two different uses of an overview map, I'd suggest two different examples. One that uses the defaults and one that uses custom options. |
The overview map could "just" draw a quadrilateral representing the main map viewport. Until we support tilt that quadrilateral will always be a rectangle. And also, I think I'd focus on the case where the overview map does not rotate with the main map. So the overview map would show a rotated rectangle when the main map is rotated. Is that making any sense? |
* rotateBox: (boolean|undefined), | ||
* target: (Element|undefined), | ||
* tipLabel: (string|undefined)}} | ||
* @api stable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove stable
here (but leave @api
). It is useless and we don't have it for the other @typedef
s. Stability is marked on individual properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Following and agreeing with @tschaub suggestion, we now have two examples:
|
I'm done with fixing everything from @elemoine review. Only two points remain undone, but those are trivial IMHO. I'd be in favor of merging this pull request "as-is" (with any additional trivial fixes if required). Discussions / new features such as showing a rotated rectangle when the main map is rotated could come in an other pull request, in an other separated discussion. After 1 and a half year of waiting, I'm eager to see this merged 😄 Thank you very much for your help |
* @type {number} | ||
* @private | ||
*/ | ||
this.minRatio_ = ol.OVERVIEWMAP_MIN_RATIO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why storing the value min and max ratio values in the instance? Why not use the constants in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Now using constants directly.
I'd be in favor of merging this. It seems to me that the overview map control still needs some work, but I'd secure this work by merging it into master, and improve on it with new PRs. And before merging I'd change all the What do others think? |
I agree with the rationale for merging (I have not reviewed but have been following the thread). |
+1 on merging without any |
@ahocevar sure, I'm on it. |
0cd615f
to
1e7fbcf
Compare
There you go. Travis build fails, but I don't think it's caused by the content of this PR. Thanks to all of you who helped me working on this control. |
@fredj any idea on the Travis build failure? |
The examples must include jquery with: <script src="../resources/jquery.min.js" type="text/javascript"></script> instead of: <script src="jquery.min.js" type="text/javascript"></script> |
Done |
Thanks. |
This replaces both the old #822 and #2444.
The following fixes were made so far:
postrender
instead of viewresolution
,center
androtation
property changes, as suggested by @tonio. The small box doesn't follow the animation of the map (i.e. while doing a pan/zoom), because the extent of the main map is always the same while animating, i.e. is equal to the end result. More about this.maximized: false
no longer worksWhat's remaining to do, which includes all comments from #822 and #2444, in my personal order of priority :