react-here-map
react-here-map copied to clipboard
Custom icon is not working in HMapMarker
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
@limistah Will this be fixed in the near future?
@limistah I've got same problem. I can make a pull req but i guess you're not maintaining this repo anymore
@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 Thank you so much!
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.
@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!
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" // ??
/>