webglearth / webglearth2

[UNMAINTAINED] WebGL Earth 2 - the source code of the project
Apache License 2.0
888 stars 212 forks source link

Creating custom markers #54

Closed lassemt closed 9 years ago

lassemt commented 9 years ago

Hey!

Is there a way to create custom dynamic markers with webGL Earth?

klokan commented 9 years ago

http://examples.webglearth.com/#markers

You can pass additional parameters when creating a marker to specify a custom image (and its width and height). For example: app.initMarker(51.507222, -0.1275, url, width, height).

lassemt commented 9 years ago

Thanks for you answer @klokan . I tried and got error in console: Uncaught TypeError: c.show is not a function in api.js on line 122.

My marker code is: marker = TravelingTheGoodVibes.map.initMarker( position[0], position[1], "http://www.travelingthegoodvibes.dev/content/uploads/2014/08/test_logo.png", 75, 111);

And is it possible to make a non-image marker? Use div instead, and then style it with css ect.?

petrsloup commented 9 years ago

Although the above mentioned way should work as described, the alternative is to use WE.marker. See update example: http://examples.webglearth.com/#markers

You can also use completely custom DOM instead of image. For example https://github.com/cultureglobe/cultureglobe/blob/master/src/main.js#L413 uses this to create custom elements.

williamdarkocode commented 4 years ago

@petrsloup Is there a Javascript implementation example of the custom DOM method as you mentioned above?

williamdarkocode commented 4 years ago

Any comments on whether one can create custom DOM markes will be greatly appreciated