Skip to content
/ location Public

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

License

Notifications You must be signed in to change notification settings

qor/location

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published