Objective

Creation of a WordPress plugin to show different locations on the map and select them by Country, State and City without reloading the page.

How It Works

The user can register the locations via a specific section in the administrative area. He only needs to enter the latitude and longitude coordinates, because when saving the location, the system already identifies the country, state and city of those coordinates.

Also, if you want, you can enter additional information to the location that will appear as an information box associated with the marker.

Once published, the locations are automatically available on the map and in the selection fields. The user can then publish the map anywhere on the site with a simple code (shortcode).

Characteristics

For those with some programming knowledge, here are some of the features of the project:

  • Languages ​​used: PHP and Javascript
  • It uses an external API in the administrative area to search for the Country, State and City according to the coordinates entered by the user, this is done only once during the publication of the location, to save calls
  • Uses WordPress Rest API to serve the information
  • Commented in English to make it easier for other programmers to understand
  • Fully validated and sanitized
  • Application via shortcode
  • Internationalized

Improvement Points

Some items that can be improved for the next versions:

  • Present countries with their proper names and not just codes
  • Give the user the option to select the type of marker or upload custom markers
  • Give the option to insert images and other more complex structures in the information boxes