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

Grid Reference is broken in OpenLayers6.10 #721

Closed
logue opened this issue Jan 3, 2022 · 2 comments
Closed

Grid Reference is broken in OpenLayers6.10 #721

logue opened this issue Jan 3, 2022 · 2 comments
Labels

Comments

@logue
Copy link

logue commented Jan 3, 2022

After upgrading to OpenLayers 6.10, the drawing of the Grid Reference has become strange.
The display order is in the back, and the scale is also strange.

Also, the position of the scale slider etc. will be incorrect and will not be displayed.

It is also reproduced on the demo site.
https://viglino.github.io/ol-ext/examples/canvas/map.control.gridreference.html

By the way, is it possible to change the start character?
Starting from minus like "-C -B -A A B C", starting from the middle like "7 8 9", etc.

@Viglino
Copy link
Owner

Viglino commented Jan 3, 2022

It seems ol v6.10 has broken css for the FixedOverlays...
Last commit should fix the bug.

Viglino added a commit that referenced this issue Jan 3, 2022
@Viglino
Copy link
Owner

Viglino commented Jan 3, 2022

By the way I've added a getHIndex and getVIndex to let you set your own index function...

var ref = new ol.control.GridReference({
  extent: [ -550000, 5250000, 850000, 6650000 ],
  size: [10,12],
  target: document.querySelector(".options div"),
  source: vectorSource,
  property: "commune",
  sortFeatures: sort,
  indexTitle: title
});
// Default index
ref.getVIndex = function (index) {
  return index;
};
ref.getHIndex = function (index) {
  return String.fromCharCode(65 + index);
};
// add control
map.addControl (ref);

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

No branches or pull requests

2 participants