Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6615205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:26:02+00:00 2026-05-25T20:26:02+00:00

I’m learning how to build a WordPress Google Map plugin. I’ve got a map

  • 0

I’m learning how to build a WordPress Google Map plugin. I’ve got a map with a form. The user makes selections on the form, data will be pulled from a MySQL database, and then markers will be added to the map.

I’ve got 3 main parts to my project:

a) A PHP file that has the form and the MySQL SELECT statement for handling the form’s selections.
b) A Javascript script that builds the Google Map, and calculates the map’s bounds
c) A jQuery script that has datepickers. It also serializes the form’s selections and posts them to the PHP page.

My problem is that, in addition to the form data, I need the latlongs of the 4 corners of the Google Map in order to select the data from the database. I know how to calculate the bounds using Google Maps’ functions in script (b). My problem is that I don’t know how to return the variables in (b)

var maxLat = ne.lat();
var maxLong = ne.lng();
var minLat = sw.lat();
var minLong = sw.lng();

back to the PHP page. These values aren’t in the form that I’m serializing. They are in the javascript script file (b), not the jQuery script (c) that has the post functions. Also, the variables are calculated after the map loads. So, I can’t just leave the variables outside of a function and access them from script (c).

What’s the best way to give the PHP access to these variables?

Should I try to do a separate post for these values? Is there a way to allow script (c) access to the variables in script (b), and then add them on to the the form’s post data somehow?

Please advise what’s the best way to tackle this problem. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:26:02+00:00Added an answer on May 25, 2026 at 8:26 pm

    If there is no possibility to let (c) wait for (b), another POST will probably have to do. You can use jQuery’s $.post for that. POSTs are quite easy with that. Just be sure to pass an array of your Lons and Lats to it. You may also supply a callback function that will be executed once the POST succeeded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.