Contact with us : info@onesystem.online

Easy Google Library - Wordpress plugin

Easy Google Library plugin for WordPress

Easy Google Library is a WordPress plugin which allows developers to set and use Google Map’s and set analytic services in shortest time. Almost any web project today needs Google Maps and analytic services to be set for the website.

It looks like a little job, but for each project specially in different themes action hooks, widgets, short-codes, preparing custom options are costing quite a time.

Easy Google Library is a bridge software for some Google services. By end of 2018 Google has changed pricing policy for map and some other API services. To use Easy Google Library you need to have a google account and enabled minimum Maps Javascript  API. If you want to be able to search places from your admin utility, you need to activate also Places API and Geolocation API. If you don’t have an API account yet and for more information about pricing Google map service follow the link below.

Google Maps JavaScript API > Get API Key

[siteorigin_widget class=”EasyGoogleLib_Map”][/siteorigin_widget]
[siteorigin_widget class=”EasyGoogleLib_Map”][/siteorigin_widget]
[siteorigin_widget class=”EasyGoogleLib_Map”][/siteorigin_widget]
[siteorigin_widget class=”EasyGoogleLib_Map”][/siteorigin_widget]

Setup instructions

  • Download the plugin zip file.
  • In WordPress admin
    • Go to Dashboard > Plugins.
    • Click on new plugin and upload zip file.
    • Click on Activate.
    • Under Dashboard > Settings click on EasyGoogleLibrary settings.
    • Enter your Google Maps Javascript API key and Google Analytics key.
  • You are ready to use Easy Google Library.

How to use Easy Google Library

You may use Easy Google library by widget or programatically.

Using wordpress widget

Easy Google Library provides a widget with user friendly interface. Widget you may use by WordPress widget area and for the pages content you may access it by shortcode or with any interface builder such as SiteOrigin Page Builder.

  • Open Dashboard > Appearence > Widgets
  • Add Easy Google Map from available widgets to any side bar location.
  • Click on widget to modify your preferred settings.

On widget settings you have various options.

  • General settings
    • Title
    • Object ID
    • Maptype (default road)
    • Width and Height for map (default is 100%)
    • Label for direction links

 

  • Marker defaults (Places defaults)
    These options represent default settings for every new marker that you will add to map.

    • Show direction link
    • Show icon
    • Show label

 

  • User Controls
    These options represents which map controls will be visible to end-user.

    • MapType
    • Zoom
    • Fullscreen
    • Scale
    • Rotate
    • Streetview

 

  • Locations tool
    After you setup map default layout, you may click on Add location button to add markers (places) to your map. Easy Google Library allows you to make multiple locations in one map.

You may create a map for 1 or more places on same time.
If you have Google Places API and Google Geolocation API activated you may use Geolocation search to set coordinates.

Adding locations to map

When you click on Add Location button, a popup window will open with location settings. Enter obligatory and visual options here and click on save button. You may edit this entry from the widget everytime. Repeat the process for additional locations.

  • Title : Google Map title
  • Location coordinates
    If you have already activated Google Places API for the key you are using, you may search directly here for the location. Otherwise you may get the location coordinates from https://www.google.com/maps website.

    • Set location by Google placesWrite in geolocation input box the address or the name of place. Choose the location from drop down box.
    • Set location using Google Map websiteGo to https://www.google.com/maps website. On the search box find your desired location.
      When site showed you the location from the url you may extract Lat (X) and Lng(Y) values and enter input boxes as shown in picture below.

 

  • Information text

    This input accepts html raw text. You may put here html formatted content. It will not encode itself. If you fill this box, visitor will get a memo box when they click on marker. You may add here text, pictures and other html based media. You may change the visiual by changing css properties.
  • Link target and linkYou may use this field with 3 options.
    To have a regular a link and choose opening in same page or blank.
    If you choose js call then you may enter here the js code which you want to trigger.
  • Location Icon
    If you click on icon you may choose/upload a new icon for your location (32px X 32px).
  • Other options
    • Show direction link :End user will see a memo box with link to google website with direction information.
    • Show iconshow marker icon on map.
    • Show labelshow the label of marker on map.

Adding a map programmatically

After you activated Easy Google Library you may design a map programmatically.

You need to define map and location parameters as array and
call EasyGoogleLib_MapDraw($MapDefinition);

Please click here to download sample PHP file. Code in sample file will output the map below.

Adding a map with shortcode.

Shortcodes are strong items of WordPress. Specially If you are using a builder, they are handy.With below shortcode also you create the same map below.

[EasyGLMap title=”Test Locations” maptype=”roadmap” height=”500″ zoom=”13″ directionlabel=”Click to see directions” fullscreencontrol=”1″ zoomcontrol=”1″ streetviewcontrol=”1″]
[EasyGLLocation label=”LOCATION 1″ mapx=”44.814598″ mapy=”20.465285999999992″ infotext=”This memo box is for 1st marker on this map.” showicon=”1″ showdirection=”1″ showlabel=”1″/]
[EasyGLLocation label=”LOCATION 2″ mapx=”44.786568″ mapy=”20.4489216″ infotext=”This memo box is for 2nd marker on this map.” showicon=”1″ showdirection=”1″ showlabel=”1″/]
[/EasyGLMap]

LOCATION 1
LOCATION 2