1

I am working with a map on which I put an overlay to highlight certain areas, now I want to zoom the map in and out and reposition the overlay so that it is still over the same region. The map is displayed in a JavaFX WebView and the overlay is a polygon that is drawn into a group that is in a pane on top of the WebView.

Now I am trying to calculate the correct position for the overlay, but I can't figure out how. Does someone have some experience there and maybe can point me into the right direction ?

Samarek
  • 444
  • 1
  • 8
  • 22
  • You know the local bounds of the rectangle in the webview? Use `Node.localToParent` until you reach the common ancestor and then if neccessary aply any transformations for the group using `Node.parentToLocal`... – fabian May 09 '18 at 09:35
  • If I am getting you right then I guess I wasn't clear enough and you misunderstood me (or rather my faulty description). I updated the question. – Samarek May 09 '18 at 09:47
  • Gluon has a mapping library that might help you achieve your desired outcome if you're open to using something other than a WebView. Check out [this SO answer](https://stackoverflow.com/questions/36952625/create-a-polyline-in-gluon-maplayer). – RonSiven May 09 '18 at 15:14

0 Answers0