Question: I have seen few examples of using geoip in node.js such as <https://github.com/kuno/GeoIP.git> and <https://github.com/wadey/node-geoip>. However what i want is to display the map showing geoip for the particular loged in user.How can it be implemented.

Answer: 
You can get a geolocation database (such as from <http://www.maxmind.com>) and store it in mongo. Each record contains an IP range (start/end) and the latitude/longitude associated with that IP range. IPs are represented as integers. You could create an index on the `start` field, and do a query on mongo to find the record with the largest value of `start` which is smaller than the IP of your client user, and look up the corresponding lat/lon.

As for plotting a map with this lat/lon, it's very easy to create a google map which is centered on a particular location: (View source at: <http://code.google.com/apis/maps/documentation/javascript/v2/examples/map-simple.html>)

There are a lot of different ways of storing/querying geolocation data, but this is just one possible approach using mongo that might work. Hope this helps.
extending mpobrien's answer-

I found this to be easier and faster approach.
----------------------------------------------

Download the binary db at maxmind

<http://dev.maxmind.com/geoip/geoip2/geolite2/>
<http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz>

Use node-maxmind-db

<https://github.com/PaddeK/node-maxmind-db>

```
var mmdbreader = require('maxmind-db-reader');

// open database
var countries = mmdbreader.openSync('./countries.mmdb');

// get geodata
app.get('/api/v1/ip/', function(req, res) {
    var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;

    countries.getGeoData(ip, function(err, geodata) {
        if(!err && geodata.location) return res.json({success: true, location: geodata.location});
        return res.json({success: false, location: null, error: err});
    });
});

```

Then you will have user location based on his ip address which you can display on map.

Benefits-

The bindary data file is small and easy to update. No db import export.
Just swap the file and reload the data. ie- `mmdbreader.openSync()`