Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

2
[Help] Adding extra markers to Google Maps API
Post Flair (click to view more posts with a particular flair)
Author Summary
qtx is in help
Post Body

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)

Author
Account Strength
0%
Account Age
15 years
Verified Email
Yes
Verified Flair
Yes
Total Karma
429,690
Link Karma
33,109
Comment Karma
394,377
Profile updated: 6 months ago
Posts updated: 11 months ago
qtx

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago