[question] Making map markers
See original GitHub issueI saw the blog posts, for example, but it didn’t go into much depth beyond making a geojson provider.
I’m wondering how to make and manage map markers on a global scale.
This video shows a more complicated harp.gl example, but no link to any source code example: https://www.youtube.com/watch?v=9jB-3AyqkoE
Suppose we want:
- custom geometry for map markers
- billboard the markers
- clustering when zooming out
- showing the same amount of markers at any zoom level, but which markers are shown depends on importance at that zoom level (like a regular Google Maps type of a thing).
- tool tips for the markers showing information (images/text)
- to manage all the markers efficiently (for example instead of creating a new
GeoJsonDataProvider
for every update when we want to show a new set of markers) - fading them in and out
Any thoughts or ideas on those points? Correct me if I’m wrong, but this stuff still needs to be implemented on top of harp.gl, and there’s no such tools yet, right?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Map Marker Question Icon | Font Awesome
Map Marker Question icon in the Version 5 Solid style. Make a bold statement in small sizes.. Available now in Font Awesome Pro....
Read more >Markers | Maps JavaScript API - Google Developers
A marker identifies a location on a map. By default, a marker uses a standard image. Markers can display custom images, in which...
Read more >How to make map cover all markers in javascript?
I have an issue with Google Map in javascript, I can not make all markers fit bounds. Only the first marker is visible....
Read more >How can I make a map-marker's popupContent be a random ...
I'm using leaflet.js to make a map and I need help with the javascript required to make a map-marker generate a random phrase...
Read more >How to add markers to Google Map API | Support Center
I want to add markers to a maps. The marker locations will be stored in a 'Pick up locations' Data type. I'm struggling...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@trusktr
You can do this by implementing your own
DataSource
, creatingTextElement
objects and adding them to theTile
withTile.addTextElement
. We do have an internal example, I’ll create a ticket to make it publicly available. Meanwhile, here some code snippet: ` class UserMarkerDataSource extends DataSource { private tile?: Tile; private nextFeatureId: number = 0; constructor( ) { super(“markers”); this.cacheable = true; }`
A
TextElement
can have so far an icon and a piece of text. Additional attachments are not supported so far. You could manage to make tooltips pop up whenever a marker is selected by the user. For that, you can pick text elements (or any other map object) usingMapView.intersectMapObjects
. From that you’ll get whether a text element was picked and what’s its featureId. Then you can add a text element next to it usingMapView.addOverlayText
.We don’t support label clustering yet, we might add it since it’s a useful feature but we don’t have a plan for it yet.
You can so far assign priorities to the markers, so that higher priority markers will displace other markers with lower priority on collision. There’s no way to set text element limit on a map view though.
About the youtube video, it was intended to illustrate one of the “dream states” of a new react-harp component that is currently being built outside of the harp team… We will post more news once we have a simple version including default markers and a basic clustering mechanism.