Since we are doing a project on tourism, we are involved in the map function. One of the tasks I received was to show a few designated sights on the map and add markers to the map.
Our project is a Sogou map, using the JS version. If you are interested, you can refer to the Search Map API and sample code.
Adding markers to a map is a basic feature of the map. This mark is called marker. You can get an introduction to the marker class from here crossing online.
The basic steps of the implementation, first create a map on the page, and then add a marker on the map. You can specify the location, display content, marker on the map, and so on. See the code for details:
:
isn't it simple? In fact, with these, just one of the simplest styles. In the next blog post, we add luster to him. Please look forward to it.
Add a marker to the JS version of the search map