Comments (7)
I see this in the middle of the map on your last example:
Also, I would recommend getting new credentials and invalidating the one you publicly posted here. That API key is not something that should be made public AFAIK.
from maps-api-for-javascript-examples.
Hi @chiragkoli, you can create your custom marker by adding an instance of H.map.Icon
as a parameter when you create a H.map.Marker
.
For example:
const svgMarkup = '<svg height="100" width="100" xmlns="http://www.w3.org/2000/svg">' +
'<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" /></svg>';
const customIcon = new H.map.Icon(svgMarkup);
const customMarker = new H.map.Marker({lat: 41.8625, lng: -87.6166 }, {icon: customIcon});
More info in the API documentation:
https://developer.here.com/documentation/maps/topics_api/h-map-marker.html#h-map-marker
https://developer.here.com/documentation/maps/topics_api/h-map-icon.html#h-map-icon
from maps-api-for-javascript-examples.
Thanks for your answer!
Unfortunately the marker is not displayed locally on my computer.
from maps-api-for-javascript-examples.
@Mexikaner9 what browser do you use? Do you access the page locally with the file:// protocol?
from maps-api-for-javascript-examples.
Google Chrome and Mozilla Firefox.
from maps-api-for-javascript-examples.
@Mexikaner9 hello how did the custom marker work? can you tell me
from maps-api-for-javascript-examples.
Don't bother trying to create your own map icons, instead, you can use these:
http://map-icons.com/
from maps-api-for-javascript-examples.
Related Issues (20)
- [Issue] Opening an Infobubble on a Mouse Click HOT 4
- Is there a way to identify road type (dirt road, functional class type) on the map? HOT 2
- avoid multiple areas in v8 route api HOT 2
- HERE Maps API JS : How to change the date format in incident popup? HOT 1
- cannot install simple-element-resize-detector HOT 2
- Tangram: Style: error compiling program
- how drawing polygon HOT 2
- TypeScript definition errors HOT 3
- Delay to open 10000+ data, page stuck and alert display to exit page or wait on chrome HOT 2
- Polyline Arrows not showing
- Are map views still available when using themed via Map Style Editor map? HOT 2
- Is there any way to change the width of the Infobubble? HOT 2
- Is there any specific time to live for routeHandle? HOT 1
- Map Editor Style / HARP Engine with UI and InfoBubbles HOT 2
- HereMap
- Routing: allow to ignore road restrictions - option to allow restricted roads
- Heatmaps aren't working when migrating to Harp engine. HOT 2
- CSP Blocker on Nginx
- Harp Engine - Draggable Marker Demo - performance issues HOT 1
- Error when dispose map HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maps-api-for-javascript-examples.