/location

Qor Location - Make your struct support pick up location from google map in Qor Admin

Primary LanguageJavaScriptMIT LicenseMIT

Location

Location picks up location details from an interactive Google Map widget when creating/editing any applicable Resource in Qor Admin.

Usage

To use Location with QOR Admin, simply embed location.Location in a model then behold the map picker in the QOR Admin interface.

import (
  "github.com/jinzhu/gorm"
  "github.com/qor/location"
)

type Store struct {
  gorm.Model
  Name string
  location.Location
}

Embedded location.Location brings these attributes to your struct

type Location struct {
  Address   string
  City      string
  Region    string
  Country   string
  Zip       string
  Latitude  float64
  Longitude float64
}

Now, you can call Store.Address or Store.Country etc. to get the address of the store.

Location Demo: http://demo.getqor.com/admin/setting

License

Released under the MIT License.