This post has been de-listed (Author was flagged for spam)
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Javascript isn't my forte but I can get by by trying to read the code and just figuring it out from there, but I can't seem to get this working.
I made a fiddle here, https://jsfiddle.net/aed9ajr7/1/
What I am trying to do is add more markers to that map and from what I've read it should be as simply as adding this for it to add more markers:
var locations = [
['Bondi Beach', 29.461739, -81.251943, 4],
['Coogee Beach', 29.462075, -81.253735, 5],
['Cronulla Beach', 29.461235, -81.251922, 3],
['Manly Beach', 29.461664, -81.254389, 2],
['Maroubra Beach', 29.462066, -81.251192, 1]
];
These are just some random locations that are near the center of the map on jsfiddle.
I think it conflicts somewhere since the jsfiddle example uses a custom marker, or maybe I just keep forgetting to add some extra code to make it work. ¯\(°_o)/¯
Could someone help me out and tell me where I'm going wrong?
Thank you in advance.
edit: Solved it myself
I'll leave the post up in case anyone else needs it.
I added:
var marker2 = new google.maps.Marker({
position: new google.maps.LatLng(newlatitude, newlongitude),
map: map,
visible: true,
icon: marker_url,
});
after var marker = new google.maps.Marker({.......});
and that did the trick.
(change lat & lon to the ones you want added)
Subreddit
Post Details
- Posted
- 8 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/javascript/...