add a link to OSM map as a CapGeolocIp field and make the application fill it
This commit is contained in:
parent
96c7dab513
commit
00112b3e51
2 changed files with 3 additions and 0 deletions
|
|
@ -40,4 +40,6 @@ class Geolooc(ReplApplication):
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
for location in self.do('get_location', argv[1]):
|
for location in self.do('get_location', argv[1]):
|
||||||
|
if location.lt and location.lg:
|
||||||
|
location.osmlink = u'http://www.openstreetmap.org/?mlat=%s&mlon=%s#map=13/%s/%s' % (location.lt, location.lg, location.lt, location.lg)
|
||||||
self.format(location)
|
self.format(location)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ class IpLocation(BaseObject):
|
||||||
country = StringField('Country')
|
country = StringField('Country')
|
||||||
lt = FloatField('Latitude')
|
lt = FloatField('Latitude')
|
||||||
lg = FloatField('Longitude')
|
lg = FloatField('Longitude')
|
||||||
|
osmlink = StringField('Link to OpenStreetMap location page')
|
||||||
host = StringField('Hostname')
|
host = StringField('Hostname')
|
||||||
tld = StringField('Top Level Domain')
|
tld = StringField('Top Level Domain')
|
||||||
isp = StringField('Internet Service Provider')
|
isp = StringField('Internet Service Provider')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue