Skip Navigation

[Closed] Classic Views and Maps

This support ticket is created 3 years, 8 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.

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 8 replies, has 2 voices.

Last updated by Shane 3 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#2062819

Tell us what you are trying to do?
I am using the old Views (not blocks) to design a CPT, with an address field.
I want to display map, with a marker for the dynamic field "Address".
I can display the map, but I am struggling to connect the map to the Address field.

Is there any documentation that you are following?
Not really. Links to some documentation are broken, and most of your documents deal with block view only.

Is there a similar example that we can see?

What is the link to your site?
In development

#2062973

Shane
Supporter

Languages: English (English )

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

Hi Eve,

Most of our old documentation have been removed.

Can you do a short recording of exactly what you've done so far so that I can best advise ?

In the classic view it should be as simple as inserting the map with the Fields and Views button and then just inserting the map marker with the correct target for the map ID.

However I need to know exactly where in the process you are having issues.

Thanks,
Shane

#2063389

I'm struggling with the "then just inserting the map marker with the correct target for the map ID." part.

Where exactly does the value of the address field go? I've tried the below (adapted from some of your documentation), but no marker appears.

Thanks!

[wpv-map-render map_id="my-map" map_width="600px" map_height="300px" fitbounds="off" general_zoom="6" single_zoom="15" cluster="on"]
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="[types field='facility_address'][/types]"]This is the content of the marker popup.[/wpv-map-marker]

#2063393

Hi,

I'm having problems with the "then just inserting the map marker with the correct target for the map ID." part. Where exactly do I put in the address field?

I've tried the below, adapted from your documentation, but no marker appears.

Thanks,

[wpv-map-render map_id="my-map" map_width="600px" map_height="300px" fitbounds="off" general_zoom="6" single_zoom="15" cluster="on"]
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="[types field='facility_address'][/types]"]This is the content of the marker popup.[/wpv-map-marker]

#2063395

Hi,

I'm having problems with the "then just inserting the map marker with the correct target for the map ID." part. Where exactly do I put in the address field?

I've tried the below, adapted from your documentation, but no marker appears.

Thanks,

[wpv-map-render map_id="my-map" map_width="600px" map_height="300px" fitbounds="off" general_zoom="6" single_zoom="15" cluster="on"]
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="[types field='facility_address'][/types]"]This is the content of the marker popup.[/wpv-map-marker]

#2063501

Shane
Supporter

Languages: English (English )

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

Hi Eve,

Since you are using the classic editor for views, then you will format it like this.

[wpv-layout-start]
[wpv-map-render map_id="my-map" map_width="600px" map_height="300px" fitbounds="off" general_zoom="6" single_zoom="15" cluster="on"]
	[wpv-items-found]
	<!-- wpv-loop-start -->
[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="[types field='facility_address'][/types]"]This is the content of the marker popup.[/wpv-map-marker]

<ul class="wpv-loop js-wpv-loop">
<wpv-loop>

  • [wpv-post-body view_template="loop-item-in-my-view-with-conditional-blocks"]
  • </wpv-loop>

    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
    [wpml-string context="wpv-views"]No items found[/wpml-string]
    [/wpv-no-items-found]
    [wpv-layout-end]

    [/php]

    Or you can add the marker code inside the content template of this view. Either way should work as long as the marker is withing the wpv-loop-start tags.

    Thanks,
    Shane

    #2065605

    Hi,

    It's still not working for me. I can render the map, but the map is not recognising the field address, so there is no marker on it. (The field address has been specified as type "address" in the CPT)

    my code in hte view:

    [wpv-layout-start]
    [wpv-map-render map_id="my-map" map_width="600px" map_height="300px" fitbounds="off" general_zoom="8" single_zoom="15" cluster="on"]

    [wpv-items-found]
    <!-- wpv-loop-start -->
    <wpv-loop>
    [wpv-post-body view_template="loop-item-in-facility_map"]
    </wpv-loop>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
    [wpml-string context="wpv-views"]No items found[/wpml-string]
    [/wpv-no-items-found]
    [wpv-layout-end]

    AND, Loop item in facility_map:

    [wpv-map-marker map_id="my-map" marker_id="my-marker" marker_title="This is a marker" marker_field="[types field='facility_address'][/types]"] This is the content of the marker popup.[/wpv-map-marker]

    [types field='facility_address'][/types]

    (Note that the text for "facility_address" is rendering correctly under the map).

    Any ideas? Thanks!

    #2065777

    Update: I tested the maps functionality using blocks, and it works perfectly. So the problem is not with the API or anything like that. Thanks.

    #2065853

    Shane
    Supporter

    Languages: English (English )

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

    Hi Eve,

    Thank you for the additional information.

    At this point it would be best if I had a look at the view itself.

    Would you mind allowing me to have admin access to the site so that I can have a look ?

    I've enabled the private fields for your next response.

    Also please send the frontend page that the view is on.

    Thanks,
    Shane

    The topic ‘[Closed] Classic Views and Maps’ is closed to new replies.