react-here-map icon indicating copy to clipboard operation
react-here-map copied to clipboard

Custom icon is not working in HMapMarker

Open subtirelumihail opened this issue 5 years ago • 7 comments

I am trying to render a custom icon HMapMarker but the icon prop seems to be ignored and defaults to the here maps marker icon

This is because options is not initialised with a default value like {} You can see here https://github.com/limistah/react-here-map/blob/master/src/components/HMap/objects/Marker.js#L23

subtirelumihail avatar Nov 27 '19 16:11 subtirelumihail

@limistah Will this be fixed in the near future?

RobinUit avatar Sep 07 '20 12:09 RobinUit

@limistah I've got same problem. I can make a pull req but i guess you're not maintaining this repo anymore

halilbrhmtrn avatar Oct 15 '20 17:10 halilbrhmtrn

@halilbrhmtrn Since i needed to use the here-maps for a React project im currently working on i decided to build further on this library. I have added alot of features already and you might want to check it out if you need some more working things. I have not actively updated the documentation yet, so you might have to figure some things out for yourself / check the code / ask me, but it has a lot of functionality this library doesnt include.

Source code can be found here: https://github.com/Coffee-IT-Development/react-here-map

Project can be implemented from NPM: https://www.npmjs.com/package/@robinuit/react-here-maps-library

Check the TODO file to see the features i added and will be adding and feel free to give me any tips or feature requests.

Im also working on a typings file but i have not come to add this yet.

RobinUit avatar Oct 15 '20 18:10 RobinUit

@RobinUit Thank you so much!

halilbrhmtrn avatar Oct 15 '20 18:10 halilbrhmtrn

hi @halilbrhmtrn, kindly make the pull request.

I have been expecting extra hands to push this repo forward. There are still many features to be improved/included.

limistah avatar Oct 15 '20 19:10 limistah

@halilbrhmtrn Since i needed to use the here-maps for a React project im currently working on i decided to build further on this library. I have added alot of features already and you might want to check it out if you need some more working things. I have not actively updated the documentation yet, so you might have to figure some things out for yourself / check the code / ask me, but it has a lot of functionality this library doesnt include.

Source code can be found here: https://github.com/Coffee-IT-Development/react-here-map

Project can be implemented from NPM: https://www.npmjs.com/package/@robinuit/react-here-maps-library

Check the TODO file to see the features i added and will be adding and feel free to give me any tips or feature requests.

Im also working on a typings file but i have not come to add this yet.

Nice work @RobinUit, can you add me on Twitter.

Let's move this project forward.

Thank you so much!

limistah avatar Oct 15 '20 19:10 limistah

I solved it as follows:

const markerIcon =
  '<svg width="24" height="24" ' +
  'xmlns="http://www.w3.org/2000/svg">' +
  '<rect stroke="white" fill="#1b468d" x="1" y="1" width="22" ' +
  'height="22" /><text x="12" y="18" font-size="12pt" ' +
  'font-family="Arial" font-weight="bold" text-anchor="middle" ' +
  'fill="white">H</text></svg>';

    <HMapMarker
      coords={markerCoords}
      icon={markerIcon}
      options={{ }} // empty object
      type="marker" // ??
    />

yasaricli avatar Dec 26 '20 15:12 yasaricli