Skip Navigation

[Resolved] Map markers not appearing on map… map is centered on Africa

This support ticket is created 2 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Bobby339 2 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2090421
full.png
shortcode.JPG

Tell us what you are trying to do? I am trying to get map markers from a CPT address fields to appear on a map (I've installed Maps, added an API Key, added some records in the USA, etc...).

I already have the data displaying correctly in grid format at the bottom of the page (see screenshot) but I cannot get them to appear on the map at the top of the page. The custom field is "wpcf-dealer-address". Here is the shortcode for the map (this is what is NOT working):

###########

[wpv-map-render map_id="map-1" map_height="500"][/wpv-map-render]

[wpv-map-marker map_id='map-1' marker_id='marker-1' marker_field='wpcf-dealer-address']
<h4>[wpv-post-title]</h4>
[types field="dealer-address"][/types]
[wpv-conditional if="( $(wpcf-dealer-phone) ne '' )"]Phone: [types field="dealer-phone"][/types]
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-dealer-website) ne '' )"]Website: <u>[types field='dealer-website' target='_blank'][/types]</u>
[/wpv-conditional]

[/wpv-map-marker]

###########

What am I doing wrong?

The site is still under constructions but I am including screenshots.

#2090701

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bobby,

Thanks for getting in touch.

Its quite difficult to figure whats wrong here without having a look at the site. Currently your view's code looks correct but I will need to investigate the site further to see what is causing the issue.

I've enabled the private fields for your next response so that you can share the credentials and a link to the page with the map.

Thanks,
Shane

#2090923

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bobby,

Thank you for the credentials.

I was able to find the issue. The problem was that you didn't place the marker code inside the view loop.

Take a look at the edit view link below.
hidden link

You will see that i've added your marker shortcode to the view's content template. If the code isn't placed here then the marker won't get any data to display on the map.

Please let me know if this helps.
Thanks,
Shane

#2091447

Thank you so much for figuring that out.

Hhmmmm. So is there any need for the content of the marker to actually be on the page (in that HTML module) if that information is coming from the View? Can I remove that marker code from the page?

#2091453

I guess I just don't understand how the information from the map marker (that is not connected to the map) gets loaded onto the map? Does it all come down to the map_id='map-1'?

#2091739

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Bobby,

Hhmmmm. So is there any need for the content of the marker to actually be on the page (in that HTML module) if that information is coming from the View? Can I remove that marker code from the page?

No there is no need for it to be on the actual page given that it needs to be in the view itself to function. Yes you can remove the marker code from the page.


I guess I just don't understand how the information from the map marker (that is not connected to the map) gets loaded onto the map? Does it all come down to the map_id='map-1'?

Let me see if I can provide a bit more clarity for you. The map marker automatically gets the address data from the current post that is being displayed in the view loop.

What links the Map and the marker is the map_id parameter. This tells the marker which map it should display on. Once the marker's shortcode is on a page or view it will automatically get the address data of that post.

Please let me know if this provides clarity for you.
Thanks,
Shane

#2092299

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.