Unicor-p / ts-map

ATS/ETS2 map renderer and cities / poi extractor
https://unicor-p.github.io/ts-map/
MIT License
22 stars 2 forks source link

Zoom and icon size #19

Open meatlayer opened 2 years ago

meatlayer commented 2 years ago

Hello. It would be nice to replace the lines in the file: TsMapRenderer.cs

https://github.com/Unicor-p/ts-map/blob/master/TsMap/TsMapRenderer.cs#L387

g.DrawImage(b, overlayItem.X - b.Width, overlayItem.Z - b.Height, b.Width * 2, b.Height * 2);
g.DrawImage(b, overlayItem.X - b.Width, overlayItem.Z - b.Height, b.Width + zoomCaps[zoomIndex] / 100, b.Height + zoomCaps[zoomIndex] / 100);

https://github.com/Unicor-p/ts-map/blob/master/TsMap/TsMapRenderer.cs#L432

g.DrawImage(b, point.X, point.Y, b.Width, b.Height);
g.DrawImage(b, point.X, point.Y, b.Width + zoomCaps[zoomIndex] / 25, b.Height + zoomCaps[zoomIndex] / 100);

https://github.com/Unicor-p/ts-map/blob/master/TsMap/TsMapRenderer.cs#L498

g.DrawImage(b, newPoint.X - b.Width / 2f, newPoint.Y - b.Height / 2f, b.Width, b.Height);
g.DrawImage(b, newPoint.X - b.Width / 2f, newPoint.Y - b.Height / 2f, b.Width + zoomCaps[zoomIndex] / 100, b.Height + zoomCaps[zoomIndex] / 100);

https://github.com/Unicor-p/ts-map/blob/master/TsMap/TsMapRenderer.cs#L517

g.DrawImage(b, newPoint.X - b.Width / 2f, newPoint.Y - b.Height / 2f, b.Width, b.Height);
g.DrawImage(b, newPoint.X - b.Width / 2f, newPoint.Y - b.Height / 2f, b.Width + zoomCaps[zoomIndex] / 100, b.Height + zoomCaps[zoomIndex] / 100);

https://github.com/Unicor-p/ts-map/blob/master/TsMap/TsMapRenderer.cs#L535

g.DrawImage(b, triggerItem.X, triggerItem.Z, b.Width, b.Height);
g.DrawImage(b, triggerItem.X, triggerItem.Z, b.Width + zoomCaps[zoomIndex] / 100, b.Height + zoomCaps[zoomIndex] / 100);

This will allow you to automatically change the scale of icons on the map when you zoom out or zoom in on map tiles. An example of how this will change depending on the scale is in the screenshots below. 1_2022-10-31 071329 2_2022-10-31 071415 3_2022-10-31 071557

JAGFx commented 2 years ago

Hi,

Thanks for your suggestion. It's be a great adjustment. I'll try it on in the next following days. Thx.

Note: This project works only on the feat/@next branch.