The title and description will be used in info window, and then we add the event listeners to the marker object, which can make info window pop-open, or delete the marker from the map. Map coordinates, map title, description, icon path and some boolean variables. Create/Add Marker As you can see, the create_marker function requires some familiar arguments to add a marker on the map. Take a look at these functions below, first function creates the marker with specified parameters, second one simply removes the marker from database and the map, the third function is used to save marker information into the database using jQuery ajax. Custom JavaScript Functions Since our code is only going to expand, it's a good idea to break them into small functions, so that we can just pass the arguments to these functions and use them rapidly in our programs. As discussed in earlier post we can add event listeners in our JavaScript, we can simply call these function in our event listeners to do the required task. ![]() ![]() I suggest you to go through previous post first, because you don't want to get confused with markers and info windows of the map while reading this article.In this article, I have created three functions create_marker(), remove_marker() and save_marker() to make things easier. In this article we are moving to the next step, here we are going to load markers from PHP generated XML file, and we will edit/save marker information into the database, finally creating a total custom map for the website. Written by Saran on October 3, 2013, Updated October 12, 2018In previous article I discussed about loading the Google map on a HTML page, adding-removing the markers and displaying info windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |