Author Topic: QoL - selecting settlements on map  (Read 1734 times)

Cynic

  • Full Member
  • ***
  • Posts: 338
  • Karma: +16/-8
    • View Profile
QoL - selecting settlements on map
« on: March 03, 2014, 10:15:23 AM »
On Chrome at least it can be quite difficult (impossible for some at mid-distance zoom?) to click settlements. 


Since clicking on the map near a settlement has no function, is it possible/worthwhile to make clicking within a short distance of a settlement select it for settlement info purposes?


It doesn't need to be much, just so it can be reliably clicked.

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
Re: QoL - selecting settlements on map
« Reply #1 on: March 03, 2014, 01:43:32 PM »
Unfortunately, that's not as easy because the library I use (OpenLayers) doesn't support near-clicks. For the time being, you'll have to zoom in.

Cynic

  • Full Member
  • ***
  • Posts: 338
  • Karma: +16/-8
    • View Profile
Re: QoL - selecting settlements on map
« Reply #2 on: March 03, 2014, 01:44:34 PM »
Are settlement circle sizes adjustable?

De-Legro

  • M&F Dev Team
  • Sr. Member
  • *****
  • Posts: 3144
  • Karma: +105/-55
    • View Profile
Re: QoL - selecting settlements on map
« Reply #3 on: March 03, 2014, 01:45:31 PM »
Are settlement circle sizes adjustable?


I would think so, since they are sized according to the population.
He who was once known as Blackfyre

Cynic

  • Full Member
  • ***
  • Posts: 338
  • Karma: +16/-8
    • View Profile
Re: QoL - selecting settlements on map
« Reply #4 on: March 03, 2014, 01:49:53 PM »

Thanks for the info Tom/De-Legro

I guess that would help then, but also would affect how the map looks.

I'll live with it if it's more trouble than it's worth, it's just a little awkward at times!

De-Legro

  • M&F Dev Team
  • Sr. Member
  • *****
  • Posts: 3144
  • Karma: +105/-55
    • View Profile
Re: QoL - selecting settlements on map
« Reply #5 on: March 03, 2014, 02:10:06 PM »
Thanks for the info Tom/De-Legro

I guess that would help then, but also would affect how the map looks.

I'll live with it if it's more trouble than it's worth, it's just a little awkward at times!


Not having used OpenLayers myself, I am only guessing here, but it might be possible to make the click area for settlements a transparent circle that extends out past the current settlement icons,
He who was once known as Blackfyre

Tom

  • Head Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6320
  • Karma: +102/-15
    • View Profile
    • Might & Fealty
Re: QoL - selecting settlements on map
« Reply #6 on: March 03, 2014, 03:46:53 PM »
If you can tell me how to do it, I'll be happy to do it.

De-Legro

  • M&F Dev Team
  • Sr. Member
  • *****
  • Posts: 3144
  • Karma: +105/-55
    • View Profile
Re: QoL - selecting settlements on map
« Reply #7 on: March 03, 2014, 11:36:48 PM »
If you can tell me how to do it, I'll be happy to do it.


As with so many things I turned to google, and found that people have tried this and had issues. Details were sparse but they seem to suggest that firstly it only made it slightly easier to select the point and secondly there were issues when items overlap. Any way what I did was add a second feature on a second layer above the layer I used for a town icon. The second layer used a feature style that had a larger radius. To make it almost invisible I did set the following within that style



transparentStyle.fillOpacity = 0;  // from 0 (transparent) to 1 (opaque)
transparentStyle.graphicOpacity = 0; // from 0 (transparent) to 1 (opaque)     


where transparentStyle was the name I gave to the style object. Main problem I had with this was that I didn't have a way to activate the primary icons hover animation when you were hovered over the transparent part.


I also found this https://github.com/ahocevar/openlayers/compare/e3a5091ebd709742cf39a23268b6bdec128ef5ac...ahocevar:headless-render    which was suggested to be the best solution. As I understand it it offloads the vectors for feature selection to the client machine and then you can more easily set up near click calculations. There were some caveats about this though.
He who was once known as Blackfyre

Alumaani

  • Full Member
  • ***
  • Posts: 554
  • Karma: +25/-13
    • View Profile
Re: QoL - selecting settlements on map
« Reply #8 on: March 04, 2014, 09:23:01 AM »
You Tech guys really amaze me!