• Skip to primary navigation
  • Skip to main content

WP Data Sync

The only data sync API for WordPress websites.

  • Products
  • Blog
    • Code Examples
  • Documentation
    • Getting Started
    • Actions
    • Filters
    • FAQ
    • Specifications
    • Change Log
  • Contact
  • Support
  • Checkout
    • Cart
  • Account
WP Data Sync Icon

Use WP Data Sync to Develop a Map Search

Use WP Data Sync to make the development of your next project much easier. How? We seamlessly move data from its source, to its destination. This may sound simple. However, if you have multiple data sources with different array keys, data that is not in the correct format, or even raw data that needs to be processed. WP Data Sync can sort and organize the data for you.

We do this by mapping your raw data into WordPress objects. Then, we insert, update, or delete the data in your WordPress website based on the flow of new data. This keeps your WordPress website up and running. All while the data is being continuously updated behind the scenes.

Supported Data Sources

  • JSON
  • CSV
  • WordPress
  • WooCommerce
  • Google Sheets

Using WP Data Sync to Develop a Map Search

First install the WP Data Sync Google GeoCode Extension on your WordPress website.

When creating a map search, there are a few things you need.

  1. Address
  2. GeoCode Coordinates – Latitude/Longitude
  3. Meta Data for the Subject

WP Data Sync can handle these for you. We map your raw data to produce an address from a single data field or from multiple data fields. Then, we use the Google GeoCode API to process the address into GeoCode coordinates.

Once we have obtained the appropriate data. We sync the data with your WordPress website. At this point the data is ready to be used by your application.

The WP Data Sync Google GeoCode Extension provides a custom database table to allow more complex map searches. We include an SQL WHERE clause to help with distance from subject searches.

public static function within_radius_where( $latitude, $longtitude, $radius ) {

    global $wpdb;

    $table_name = self::table_name();

    if ( ! empty( $latitude ) and ! empty( $longtitude ) ) {

	    $where .= " 
                AND $wpdb->posts.ID 
                IN ( SELECT post_id FROM $table_name WHERE ( 3959 * acos( cos( radians($latitude) ) 
                * cos( radians( latitude ) ) 
                * cos( radians( longitude ) 
                - radians($longtitude) ) 
                + sin( radians($latitude) ) 
                * sin( radians( latitude ) ) ) ) <= $radius )
            ";

	}


	$where .=
		"
		AND $wpdb->posts.ID 
		NOT IN (SELECT post_id FROM $table_name 
		WHERE latitude = 0 
		AND longitude = 0)
	";


	return $where;

}

Map Search Use Cases

  • Locate Dealer
  • Locate Store
  • Search Health Care Provider
  • Search Fitness Trainer
  • Search Office Location
  • Search Property
  • And many more…

Build address from multiple data fields

In the screenshot below you can see how to build an address from multiple data fields from within a multidimensional array.

$array = [
    'address' => [
        'street_address' => '123 E Main St.',
        'city'           => 'Scottsdale',
        'state'          => 'Arizona'
    ]
];

WP Data Sync Address Fields UI Example

WP Data Sync GeoCode Mapping

Notice that you can add characters to the address for better visual presentation. In addition conditional logic is provided to allow for manipulation of the data.

Read more for a full example of how to create dynamic fields using multiple source keys.

Requesting GeoCode Coordinates

The process of requesting geocode coordinates from Google GeoCode API is all handled internally. All you need to do is obtain a Google API key and add it in the WP Data Sync GeoCode settings.

WP Data Sync API Google GeoCode settings

Ready for Development

Once the data is processed by the WP Data Sync API. It is synced into your WordPress website. At this point the data is ready for use by your application. This entire process can take only an hour or so. This translates into much shorter development and delivery times.

Contribute to the Project

  • WP Data Sync – on WordPress.org
  • WP Data Sync – on GitHub
  • WP Data Sync Google GeoCode Extension – on GitHub

Get Started

  • WP Data Sync Starter Plan Graphic

    Starter Plan

    Rated 5.00 out of 5
    $39.00 / month
    • 10,000 Requests/Month
    • Unlimited Data Sources
    • Unlimited Websites
    • Unlimited Users
    More Info
  • WP Data Sync Basic Plan Graphic

    Basic Plan

    Rated 5.00 out of 5
    $69.00 / month
    • 40,000 Requests/Month
    • Unlimited Data Sources
    • Unlimited Websites
    • Unlimited Users
    More Info
  • WP Data Sync Professional Plan Graphic

    Professional Plan

    Rated 5.00 out of 5
    $129.00 / month
    • 150,000 Requests/Month
    • Unlimited Data Sources
    • Unlimited Websites
    • Unlimited Users
    More Info
  • WP Data Sync Data Source Mapping Graphic

    Data Source Mapping

    Rated 5.00 out of 5
    $149.00 – $999.00
    Let us do the mapping for you!!
    We will map all your data sources for you, so you can move on to other projects that demand your time. One of our experts will map up to 50 fields for you in each data source.
    More Info

WP Dat Sync icon
Copyright © 2023 · WP Data Sync · Located in Scottsdale AZ

  • Developers
  • Affiliates
  • Data Access Request
  • Terms of Service
  • Privacy Policy
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT