I have looked at this webpage: link text [https://mediarealm.com.au/articles/openstreetmap-openlayers-map-markers/] and I learned from it how to make markers on Openstreetmap. But I can't figure out how to make simple text labels appear beside the markers. My question is what is the simplest way to add labels to point markers ? Here is "my" html code, which executes fine, but I want very much to place labels beside some or all of the point markers.
|
Without knowing what you have tried so far (your question does not include links) I suggest you have a look at uMap. There you are flexible to add markers with text labels of different kinds and appearances. Chose one of the instances given on the wiki page I linked to and give it a try. answered 17 Sep '20, 08:34 TZorn Thank you for telling me about uMap. That would be a perfectly good solution, except that their tiles won't load to a zoom level greater than 17 in the area that I am concerned with. Here is the map I created with uMap: [http://umap.openstreetmap.fr/en/map/anonymous-edit/499933:HZ_0NpNev93W6HehUzJ2OItXQsw ]. An alternative solution might be something like what is contained in this script here: [http://dev.openlayers.org/examples/vector-features-with-text.html ]. There you can see markers, but there are also text labels with the markers. I have tried to download the html source code of that page and to load it from my own computer, but that doesn't work, possibly because my browser doesn't know where to find some remote scripts that are given with reltive path names. So I am not even able to dissect that example, which is surprisingly the only example of Openlayers that I could find where label appear beside markers. At the end of the day, all I want to do is place a marker at a location in WGS84 coordinates and place a text label beside the marker, and then zoom in to level 19. Any help is appreciated!
(17 Sep '20, 20:22)
funOne
2
@funOne for me tiles are loading to a max zoom of 20 with that umap link. If the server has not had to display that area recently it can take a while to render depending on server load. Note also that the umap background can be changed to openstreetmap.org's default if you wish (although that only goes to z19). You can set the starting view with the icon on the right.
(17 Sep '20, 21:17)
InsertUser
I have waited for more than one hour, in which time the tile still has not loaded. Thanks for suggesting that I try changing from umap background to openstreetmap background. Openstreetmap background tile loads within 4.2 seconds: good enough. You mentioned how to set the starting view using the graphical interface. But how to set the starting map background to use Openstreetmap rather than OSM-Fr?
(17 Sep '20, 23:26)
funOne
1
You can change the starting layer also in the right hand editing panel. It's the same icon as in the left hand panel.
(18 Sep '20, 08:21)
TZorn
|
Could you fix/edit your question please? The links have gone missing.
I tried to paste my entire html document into a code block, but about half of it did not arrive inside the code block, and I don't know why not. If there is somebody who knows how to edit my question, so as to format the text so that everything between "<!DOCTYPE html>" and "</html>" appears as code, then I thank you.