https://github.com/thinkphp/moogeo
This is a simple plugin MooTools delivering various geo tasks like geolocation, reverse geocoding and content analysis.
https://github.com/thinkphp/moogeo
Last synced: 3 months ago
JSON representation
This is a simple plugin MooTools delivering various geo tasks like geolocation, reverse geocoding and content analysis.
- Host: GitHub
- URL: https://github.com/thinkphp/moogeo
- Owner: thinkphp
- Created: 2010-06-29T09:00:23.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-12-07T21:21:17.000Z (about 15 years ago)
- Last Synced: 2024-04-14T14:54:28.505Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://thinkphp.github.com/MooGeo
- Size: 125 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
MooGeo
======
This is a simple plugin MooTools delivering various geo tasks like geolocation, reverse geocoding and content analysis.

How to use
----------
First you must to include the JS files in the head of your HTML document.
#HTML
In your JS
//you can scrape a certain document at a URL for geographical locations:
new MooGeo('http://mootools.net/developers/',{
onComplete: function(o) {
if(o.place){
var out = '';
var all = o.place.length;
for(var i=0;i';
};
$('info').set('text',out);
}
}
});
//you can find the user (using the W3C geolocation API)
new MooGeo('visitor',{
onComplete: function(o) {
var out = '
Information from your IP
'+
'- '+
- WOEID: '+ o.place.woeid + ' '+
- Latitude: '+ o.place.centroid.latitude + ' '+
- Longitude: '+ o.place.centroid.longitude + ' '+
- Country: '+ o.place.country.content + ' '+
- Country Code: '+ o.place.country.code + ' '+
- Postal Code: '+ o.place.postal.content + ' '+
'
'
'
'
'
'
'
$('info').set('html', out);
}
});
or
//you can find geographical data from a text
new MooGeo('bucharest,ro',{
onComplete: function(o) {
$('info').set('text',o.place.name+' ('+o.place.centroid.latitude+', '+o.place.centroid.longitude+')');
}
});
or
//you can get the place from an IP number
new MooGeo('188.25.34.67',{
onComplete: function(o) {
$('info').set('text',o.place.name + ',' + o.place.country.content);
}
});
or
//you can get all kind of data from a latitude/longitude pair.
new MooGeo(44.4333,26.1000,{
onComplete: function(o) {
$('info').set('text',o.place.name + ',' + o.place.country.content);
}
});
//you can send the lat/lon as an array
new MooGeo([44.4333,26.1000],{
onComplete: function(o) {
$('info').set('text',o.place.name + ',' + o.place.country.content);
}
});
//you can grab simply the user's ip
new MooGeo('ipvisitor',{
onComplete: function(o) {
$('info').set('text', o.ip);
}
});
In your HTML source:
#HTML
Screenshots
-----------





