I have the following Javascript that includes both the standard Google Maps API initialize() function and custom addMarker() function. The map will
You have added the add marker method call outside the function and that causes it to execute before the initialize method which will be called when google maps script loads and thus the marker is not added because map is not initialized Do as below.... Create separate method TestMarker and call it from initialize.