Support

Account

Home Forums General Issues CPT Output all map markers to one map

Solved

CPT Output all map markers to one map

  • I’m having a bit of difficulty getting multiple markers to appear on a single map on my CPT archive page. Using the code from here, the marker divs are being output, but no map is actually appearing. I’ve got the api set up fine in that my maps elsewhere in the site with single markers look just fine.

    I should also note that the divs only output if I remove the “, $value” part from the posted snippet.

  • Bump? How has this not even been read in more than 24 hours?

  • It may be that it was read, but that no one has read it that can help you. This is a users helping other users forum.

    The best help that I can offer is to point you to additional documentation, there is a section on this page that covers adding mutliple markers near the end of the page. https://www.advancedcustomfields.com/resources/google-map/

    There is also another post on it here, but it’s quite old so I don’t know if there’s anything in it that would be helpful https://support.advancedcustomfields.com/forums/topic/multiple-post-points-on-google-maps/

  • You could be right. And I apologize if I was getting at all snarky. It wasn’t my intent. The status thing at the top said “Not Read”, so that’s what I was going by.

    I’ve looked through both of those links before posting here. Perhaps the issue is simply that the map itself isn’t appearing? I’ve got markers being generated. At the *very* bottom of the first link you provide it says to trigger the resize event using the following code:

    // popup is shown and map is not visible
    google.maps.event.trigger(map, 'resize');

    But doesn’t explain where to put the code. Does it go in functions or does it go in the map.js file? And where in either one. I tried putting it at the end of the .js file, and it broke things. Do you have any ideas what they mean by that?

    And I do truly appreciate the user help provided here. SO much. I apologize again if I sounded at all ungrateful.

  • So, after having a 2nd pair of eyes take a look, I realized it was a dumb error on my own part. In my attempt to be smart about when and where I loaded scripts, I had not set the maps script to load on this archive page. D’OH! It was loading fine for the other pages I needed the maps on, but I had built the site several months ago and just didn’t even remember this, and glancing through things it didn’t “register” in my brain either. It now works great {hangs face in abject shame}

  • No problem on being a little snarky, I didn’t really notice that, just wanted to help in any small way I could. Glad you got your problem worked out.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘CPT Output all map markers to one map’ is closed to new replies.