Location:

Overlay Management

This chapter introduces you how to add and remove overlays

Add / Remove Overlays

Add overlay

There are many types of overlays, including dot markers, popups, etc., which can all be added using the addTo method.

                        // construct point markers
                        var marker = new  nimap.Marker().setLngLat([116.405467, 39.907761]);
                        map.on('load',function(){
                            marker.addTo(map);
                        })
                    

Remove the cover

                    // The marker class removes the overlay using the remove method, and the vector graphics class uses the map.removelayer method.
                    // Remove point markers individually
                    marker.remove();
                
TOP