chichi
chichi

Reputation: 3301

Mapkit-react Inserting image to icon not working

  const imageDelegate = {
    getImageUrl(scale, callback) {
      callback(
        `https://i.scdn.co/image...`
      );
    },
  };

    <Map
      allowWheelToZoom={true}
      token="toookeenenenennn"
    >
      <Marker
        latitude={46.52}
        longitude={6.57}
        glyphImage={imageDelegate}
      />
    </Map>

I am using mapkit-react and when I checked the MapkitJs doc it says

const imageDelegate = {
    getImageUrl(scale, callback) {
        callback(`https://example.com/images/marker?scale=${scale}`);
    }
};


const annotation = new mapkit.MarkerAnnotation(
    new mapkit.Coordinate(10, 10),
    {
        glyphImage: imageDelegate
    }
);

enter image description here

But it looks like it is not passing the picture to the icon!

Upvotes: 0

Views: 27

Answers (0)

Related Questions