Skip Navigation

[Resolved] Map Marker not displaying when view the taxonomy archive

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 16 replies, has 2 voices.

Last updated by jonS-4 6 years, 12 months ago.

Assisted by: Minesh.

Author
Posts
#516702

I am trying to: display a map marker of an address field in a custom taxonomy when viewing the taxonomy archive page

I visited this URL:

I expected to see: two map markers; one at the location of Heathrow Airport, London and the other in another location in the UK using the coordinates I entered.

Instead, I got: just the marker at the coordinates I entered.

This is the code which generated this:

[wpv-map-render map_id="map-1" map_width="50%" draggable="off" scrollwheel="off" double_click_zoom="off" map_type_control="off" street_view_control="off"]

[wpv-map-marker map_id="map-1" marker_id="marker-1" marker_termmeta="wpcf-airport-address" id="airport-address-1"][/wpv-map-marker]

[wpv-map-marker map_id="map-1" marker_id="marker-2" lat="52.567790148683926" lon="0.7035858968506545"][/wpv-map-marker]
#516814

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As you said you are using taxonomy archive, could you please share the full code you have added to the "loop output editor" section of your custom taxonomy archive.

#516823

Thanks. Here's the code in full:

[wpv-layout-start]

[wpv-map-render map_id="map-1" map_width="50%" draggable="off" scrollwheel="off" double_click_zoom="off" map_type_control="off" street_view_control="off"]
[wpv-map-marker map_id="map-1" marker_id="marker-1" marker_termmeta="wpcf-airport-address" id="airport-address-1"][/wpv-map-marker] 
[wpv-map-marker map_id="map-1" marker_id="marker-2" lat="52.567790148683926" lon="0.7035858968506545"][/wpv-map-marker]

[types termmeta='airport-photo' alt='%%ALT%%' title='%%TITLE%%' size='full' align='none' style='width: 100%; height: 300px; object-fit: cover; opacity: 0.5;'][/types]

<h2 style="text-align: center; position: relative; top: -270px; text-shadow: 0 0 3px #FFFFFF;">[wpv-taxonomy-archive info="name"] - <span style="text-transform: uppercase;">[wpv-taxonomy-archive info="slug"]</span></h2>
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<ul class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<p>[wpv-post-body view_template="Loop item in Airport Archive"]</p>
		</wpv-loop>
	</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]There are currently no people or places near [wpv-taxonomy-archive info="name"] Airport. Please check back soon.[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]
#516825

I think the issue is how I put in the shortcode to get the marker location. I've literally tried everything I can think of. The airport-photo is a field in the taxonomy and that's displaying perfectly.

#517000

Minesh
Supporter

Languages: English (English )

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

I think I got the issue. The marker code shortcode not dispalying the pin because you are using marker address field and you do not mentioned for which term ID it should get address from.:

[wpv-map-marker map_id="map-1" marker_id="marker-1" marker_termmeta="wpcf-airport-address" id="airport-address-1"][/wpv-map-marker]

The id attribute should contain the numeric ID value of your taxonomy term ID for which you want to dispaly the map address.

So - for example, if you want to display address from term id 525 the shortcode should look like as given under:

[wpv-map-marker map_id="map-1" marker_id="marker-1" marker_termmeta="wpcf-airport-address" id="525"][/wpv-map-marker]

#517024

Thanks Minesh

How can I find the term id?

Cheers

Jon

#517036

Minesh
Supporter

Languages: English (English )

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

Sorry, my bad - in loop output section within the loop you will get the post ID.

So - as I understand you want to get the map address from the specific term or for the taxonomy term archive you are currently displaying.

#517037

I have created two fields in the Term Fields - one containing a photo and the other containing an address. When viewing one of the taxonomy records it's displaying the correct photo but I can't get the pin to display on the map.

Does that make sense?

#517038

Some further information. If I output the address as plain text it shows fine:

[types termmeta='airport-address'][/types]
#517202

Minesh
Supporter

Languages: English (English )

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

Could you please share problem URL and temporary access details and which address you want to display on the map.

#517375

Minesh
Supporter

Languages: English (English )

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

There seems to be some issue accessing the taxonomy term map address. Please hold on for further updates.

#517701

Minesh
Supporter

Languages: English (English )

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

I've escalated your issue to our next level support. Please hold on for further updates.

#517915

Minesh
Supporter

Languages: English (English )

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

There seems to be issue with your google API key. I've added my Google API key (unrestricted) key at:
=> Toolset => Settings => Maps tab => Google Map API key

Now - I can see map working fine.
=> hidden link

#517925

Thanks Minesh.

I wondered about the API key which is why I added the marker with coordinates. Odd that it showed that one although I'm now wondering if the API is for the address lookup and isn't needed for direct coordinates.

I'll look at my key and see what could be wrong with it.

Cheers again

Jon

#517938

Hi again

Sorry, I replied too quickly.

The marker is now showing but it seems to be getting the record from the id rather than the record of the page being viewed. All the taxonomies are showing the marker id 15.

eg. when viewing /airport/lhr it should display the marker as stored in the taxonomy lhr.

When viewing /airport/sen it should display the marker for the taxonomy sen.

I hope that's clear. I don't understand why it can show the correct photo for each one but not the map markers.

Cheers

Jon

The forum ‘Types Community Support’ is closed to new topics and replies.

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