StephanGeorg / staticmaps

A Node.js library for creating map images with markers, polylines, polygons and text.
MIT License
171 stars 50 forks source link

Why icons are so big ? #83

Closed samuel-litzler closed 1 year ago

samuel-litzler commented 1 year ago

I have an icon 512x512

I generated the map with buffer and return it to base64

bbox : [4.8514292, 45.7795070, 4.8535790, 45.7779198]

geometries on the map :

const polygon = {
    coords: [
      [
        4.8515285,
        45.7793232
      ],
      [
        4.8515285,
        45.7791700
      ],
      [
        4.8517099,
        45.7791700
      ],
      [
        4.8517099,
        45.7793232
      ],
      [
        4.8515285,
        45.7793232
      ]
    ],
    color: '#0000FFFF',
    width: 1,
    fill: '#0000FF55',
  };
  const point1 = {
    coord: [
      4.8535639,
      45.7779307
    ],
    img: `pin.png`,
    width: 10,
    height: 10
  }
  const point2 = {
    coord: [
      4.8514409,
      45.7794950
    ],
    img: `pin.png`,
    width: 10,
    height: 10
  }

result : image

So why width and height don't overwriting size?

I even try with size 1 or 0.1 but nothing change.

StephanGeorg commented 1 year ago

https://github.com/StephanGeorg/staticmaps/pull/73

StephanGeorg commented 1 year ago

Sorry, didn't have time to review the PR yet. Workaround is to resize the marker pin manually.