Giter VIP home page Giter VIP logo

Comments (7)

kjellski avatar kjellski commented on August 22, 2024 2

I see this in the middle of the map on your last example:

Screenshot 2019-08-12 at 07 47 51

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.

dbacarel avatar dbacarel commented on August 22, 2024 1

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.

Mexikaner9 avatar Mexikaner9 commented on August 22, 2024

Thanks for your answer!
Unfortunately the marker is not displayed locally on my computer.

from maps-api-for-javascript-examples.

kplotnik avatar kplotnik commented on August 22, 2024

@Mexikaner9 what browser do you use? Do you access the page locally with the file:// protocol?

from maps-api-for-javascript-examples.

Mexikaner9 avatar Mexikaner9 commented on August 22, 2024

Google Chrome and Mozilla Firefox.

from maps-api-for-javascript-examples.

chiragkoli avatar chiragkoli commented on August 22, 2024

@Mexikaner9 hello how did the custom marker work? can you tell me

from maps-api-for-javascript-examples.

AymanJabr avatar AymanJabr commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.