Skip Navigation

[Resolved] Marker would not show on map in layout as defined in post form

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to show a custom field address as a marker on a Google Map. The address shows correctly in wp-admin, but not on the front-end of the site. When I go to Toolset > Settings > Maps and click "Check API" I see an error: "REQUEST_DENIED - API keys with referer restrictions cannot be used with this API".

Solution: Remove restrictions from the Geocoding API.

Relevant Documentation:https://toolset.com/documentation/user-guides/display-on-google-maps/

This support ticket is created 5 years, 11 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by andrei-laurentiuP 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1199459

I am trying to: display a location user has selected in a post form

Post Form (creating new Business for Partners)

[credform]
<div class="form-group">
<label>Business Title</label>
[cred_field field="post_title" class="form-control" output="bootstrap"]
</div>
<div class="form-group">
<label>Business Content</label>
[cred_field field="post_content" output="bootstrap"]
</div>
<div class="form-group">
<label>Business Logo</label>
[cred_field field="_featured_image" output="bootstrap"]
</div>
<div class="form-group">
<label>Business Type</label>
[cred_field field="business-type" force_type="taxonomy" output="bootstrap" display="checkbox"]
[cred_field field="business-type_add_new" taxonomy="business-type" type="add_new"]
</div>
<div class="form-group">
<label>Areas of Activity</label>
[cred_field field="area-of-activity" force_type="taxonomy" output="bootstrap" display="checkbox"]
[cred_field field="area-of-activity_add_new" taxonomy="area-of-activity" type="add_new"]
</div>
<div class="form-group">
<label>Business Regions of Interest</label>
[cred_field field="business-regions-of-interest" force_type="field" class="form-control" output="bootstrap" required="true"]
</div>
[cred_field field="form_submit" output="bootstrap" value="Submit" class="btn btn-primary btn-lg"]
[/credform]

Displaying single Business for Partners in Layout

[wpv-map-render map_id="map-4"][/wpv-map-render]
[wpv-map-marker map_id='map-4' marker_id='marker-5' marker_field='wpcf-business-regions-of-interest'][/wpv-map-marker]

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

#1199521

Hi, I assume "Business Region of Interest" is the address field?
If so, I don't see anything obviously wrong in the Form code.
1. Is this a repeating field (allows multiple values)?
2. When you edit one of these posts in wp-admin, is the address text information stored correctly?
3. Do you see a map with the correct location appear in wp-admin?
4. Go to Toolset > Settings > Maps and click "Check API". Let me know the results.
5. Edit the Layout and add some extra content so you can debug a bit:

[wpv-map-render map_id="map-4"][/wpv-map-render]
[wpv-map-marker map_id='map-4' marker_id='marker-5' marker_field='wpcf-business-regions-of-interest'][/wpv-map-marker]
Title: [wpv-post-title]<br />
Biz Region: [wpv-post-field name="wpcf-business-regions-of-interest"]<br />

Let me know what you see when you test on the front-end of the site.

#1199585

Hi, So the API check is ok, addresses are stored correctly inside wp-admin > businesses > etc.
Also, the right address appears in front-end after Biz Region after I have added the field you mentioned to the layout. I don't see any errors in the console either - I previously had some problems with the hosting firewall. :-?? If you may, please let me know when you are available and I will give you admin access to see if you can figure out what's wrong.

Best wishes,
Andrei

#1199912

I'll be able to work on this today. Please provide login credentials in the private reply fields here.

#1200165

Please check the API again, I'm seeing an error:
"REQUEST_DENIED - API keys with referer restrictions cannot be used with this API."

#1200168

It is really strange. Yesterday it was ok... I'll try to sort it out

#1200182

In the Enabled APIs list, click Geocoding API since it has errors. In the Credentials tab, click the pencil icon in the right column. Try removing restrictions from the Geocoding API. Then go to Toolset > Settings > Maps and remove this API key from the secondary key input field and click "Check API" again. If it checks out, test the map on this post: hidden link

#1200184

My issue is resolved now. Thank you!