Skip Navigation

[Resolved] adding a marker to a map

This support ticket is created 4 years, 5 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 50 replies, has 3 voices.

Last updated by martinP-13 4 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1683847

you will need to be logged in to see any pages , login info is in previous help topics.
i have this map here hidden link
it is displaying just fine on front end here hidden link .

i want to add some markers onto the map . each cpt club displays already has associated locations to the club
at the bottom if you expand previous trials the addresses for the trial locations are already there . i want add a marker for each onto the map . i have had zero luck accomplishing this so far .

the php files are located at
single-organizer.php
single-venue.php

the events calendar have this usefull post for the fields of venues here hidden link

thankyou in advance
martin

#1684907

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The thing is that, we do not store login information as login information you shared is automatically deleted once the ticket is resolved.

Can you please share access details so I can check whats going on with your site.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1685197

i dont think the reply has gone through as private

#1685405

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is strange.

I have set the next reply to private which means only you and I have access to it.

#1686575

did you manage to look at this?

#1686941

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked the problem URL you shared: hidden link

When I click on the tab "VIEW PREVIOUS TRIAL RESULTS" - the first line i see is "There were no results found." and after that I can see the different events listed group by date and with those events I can see a link "+ GOOGLE MAP", If I click on that link it redirect me to google map with the specified address.

Do you want to display the map for those address displayed with link "+ GOOGLE MAP"? If yes: from where that "+ GOOGLE MAP" link is displayed?

I see that you shared the following files but we area displaying a single club post.
- single-organizer.php
- single-venue.php

The club post type is also a Event plugin post type not created using Toolset. I need more detail information about your issue and if possible please share few screenshot that should help me to understand your issue first.

#1689363

When I click on the tab "VIEW PREVIOUS TRIAL RESULTS" - the first line i see is "There were no results found." and after that I can see the different events listed group by date and with those events I can see a link "+ GOOGLE MAP", If I click on that link it redirect me to google map with the specified address.

ok so you are now on a club cpt , the club cpt is from the single-organizer.php .
the part that displays the VAENOL ESTATE BANGOR, WALES + GOOGLE MAP is taken from the single-venue.php , rather than click on the "= google map" click on the " VAENOL ESTATE" this will take you too the single-venue.php .

so when you goto hidden link . there is map at the TOP of this .

i want to show on THIS map all the locatios of previous events. i just dont know what custom field to call or how to call them so its just the locations connected to that club,

thankyou
martin

#1689675

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked your theme files here: hidden link
- I do not find any file namely: single-organizer.php .

However, I would like to know based on what parameter we know that the post is previous events post - do we need to compare the today's date - having said that all the event posts less than today's date is previous event - do we need to add any other additional parametere?

#1689815

you can find the files here hidden link line 509 is where it grabs the related events (from events calendar)

it can show any event doesnt have to be past events , just any event that is related to the club.

thankyou

#1689827

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sorry but I am not able to access the cpanl you shared. Can you please send me cpanel access details so that I can review your file.

I have set the next reply to private which means only you and I have access to it.

#1689835

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sorry but the shared access details is not working at this end. It says "The login is invalid." when I try to login using shared access details. Please share working access details.

#1690427

Hello! Minesh has passed the ticket to me because he was not able to login to your cPanel, probably because of a geo-blocking firewall.

From what I understand so far, you want to display on this map(hidden link) the trial locations related to this club, right?
I do not think this can be done without some Javascript custom code. But you can display those locations on another map, by creating another view, that will display the related location trials to the current club. That view will contain a map and will display the markers on that map. But you can't have one map containing both, the locations from the previous trials and the location from the club post. It may be possible to add the club location to the view of the previous trial, but that's not guaranteed, I'll have to test it before.

I tried to find the single-venue.php and the single-organizer.php files to understand better how you are building your page, but I was not able to locate those files in the child and parent themes.

I'll suggest creating the view that will display the previous trials on the club page, and we can find out how to add the club location to the view. Sounds good for you?
To build such a view, please follow this article to check how to query the related child posts(previous trails) https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/
And use Maps shortcodes to add the markers to the map. When adding the map marker, you can pull the longitude and the latitude from the Event plugin custom fields(_VenueLat, _VenueLng). First, you will have to make Toolset manage these fields in Toolset->Custom Fields.

Let me know when you get the view ready and we can continue from there to add the current club location/marker to the map.

#1697721

i dont want to create a new view as i will need to make a relationship between clubs and venues in toolset , therefore adding info manually ? , all the info is on the page all ready it ant be that hard to drag in the address field to that map surely ? i thought toolset maps was capable of displaying different address fields on a map > ?

the files are located here : single-venue/organizer.php

public_html/wp-content/themes/simply-responsive-cp/tribe-events/pro

thanks

#1701227

Hello! Let me try to answer your questions below, I'll start with the latest one:

i thought toolset maps was capable of displaying different address fields on a map > ?
Yes, Toolset is capable of that, but it needs to pull the address information. If we are on a content template, the information is available on the current post. If we are on a view, the information is available on each post in the loop.
To display all markers in the map, we'll need to pull that information for the database, either in the content template or in a view.

all the info is on the page all ready it ant be that hard to drag in the address field to that map surely ?
Indeed, the location of the club can be pulled inside the content template from the club custom fields. But the information of the "Previous trials" needs to be pulled from the view.

i dont want to create a new view as i will need to make a relationship between clubs and venues in toolset , therefore adding info manually ?
Actually we must because that view will help us pull the address information from the previous trials.
But I think that the relationship is already there, otherwise, how are the previous trials pulled.

I run a small test on my local setup, where I try to do similar things, pull one address from the current post, and pull other addresses from a view, and I was able to have all markers in one map. It consists of:
- Created a content template to display the post(similar to club), this content template contains a map and a marker.

[wpv-map-render map_id="city-map"][/wpv-map-render]
[wpv-map-marker map_id='city-map' marker_id='marker-[wpv-post-id]' marker_field='wpcf-location'][/wpv-map-marker]

Note, how I used the same map_id.
- Created a view that will pull the related posts location data(similar to previous trials). I only put the marker on the loop without adding a map:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<wpv-loop>
          [wpv-map-marker map_id='city-map' marker_id='marker-[wpv-post-id]' marker_field='wpcf-location'][/wpv-map-marker]
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

Note how it uses the same map_id as before.
- Added this view inside the first content template:

[wpv-map-render map_id="city-map"][/wpv-map-render]
[wpv-map-marker map_id='city-map' marker_id='marker-[wpv-post-id]' marker_field='wpcf-location'][/wpv-map-marker]

[wpv-view name="places-markers"] <!-- <== Adding the view inside the content template -->

The result is one map containing the content template marker(club marker) and the related posts markers(previous trials)

I hope this helps. Let me know if you have any doubts, or if you still need assistance on this, I'll log in to your website and double-check everything.

#1704979

the map on the top of the page is from toolset , the rest of the page is y the events calendar plugin ,
it uses the single-organizer.php to constuct the post , this links itself to all the events for that orgnaizer (relabled to clubs) , the events then grab the venues info from single-venue.php (this holds the fields to grab the venue) . the events containg the venue are all ready in the loop i just want to display the markers for all the pre-constructed adreesess ( if you click on any of those events it will show the map for that event.