@@ -53,8 +53,8 @@ LocalComponents.Page {
5353 function latitudeToY(latitude, map_height) {
5454 const bottom_lat = -59;
5555 const top_lat = 81;
56−
5756 const top_per = top_lat / 180.0;
57+
5858 var y = 1.25 * Math.log(Math.tan(0.25*Math.PI + 0.4 * radians(latitude)));
5959 const full_range = 4.6068250867599998;
6060 const top_offset = full_range * top_per;
@@ -153,10 +153,11 @@ LocalComponents.Page {
153153 highlightTimezone(offset);
154154 ListView.view.currentIndex = index;
155155 selectedTimeZone = timeZone;
156− print("Clicked at city with coords:", longitude, latitude);
157− print("Highlight at (x,y):", longitudeToX(longitude, map.width), latitudeToY(latitude, map.height));
158− pinImage.x = longitudeToX(longitude, map.width) - pinImage.width / 2;
159− pinImage.y = latitudeToY(latitude, map.height) - pinImage.height;
156+ //print("Clicked at city with coords:", longitude, latitude);
157+ //print("Clicked on TZ:", timeZone);
158+ //print("Highlight at (x,y):", longitudeToX(longitude, map.width), latitudeToY(latitude, map.height));
159+ pinImage.x = Qt.binding(function() { return longitudeToX(longitude, map.width) - pinImage.width / 2; });
160+ pinImage.y = Qt.binding(function() { return latitudeToY(latitude, map.height) - pinImage.height; });
160161 }
161162 }
162163 }
@@ -235,13 +236,19 @@ LocalComponents.Page {
235236 MouseArea {
236237 anchors.fill: parent
237238 onClicked: {
238− var tzAndOffset = tzModel.timezoneAndOffsetAtMapPoint(mouse.x, mouse.y,
239− Qt.size(map.width, map.height));
239+ var x = mouse.x + map.width/60; // longitude is offset by 6 degrees
240+ var y = mouse.y;
241+ if (y <= 2*map.height/3) {
242+ y = y * 0.80; // latitude is offset by ~20%, except the 1/3 southern hemisphere
243+ }
244+
245+ var tzAndOffset = tzModel.timezoneAndOffsetAtMapPoint(x, y, Qt.size(map.width, map.height));
240246 var tzId = tzAndOffset[0];
241247 var offset = tzAndOffset[1];
242248 print("Timezone", tzId, ", offset", offset);
243249 if (tzId) {
244250 resetViews();
251+ tzFilterModel.country = "";
245252 selectedTimeZone = tzId;
246253 highlightTimezone(offset);
247254 }