/***********************************************************************
X3 ChangeLog
+2006-08-09 Neil Spierling <sirvulcan@gmail.com>
+
+ * src/opserv.c: If we have a city, latitude and longitude returned
+ then show a map url. Some results have no city but a latitude and
+ a longitude. The coordinates are useless in this case and most
+ people would know where the country is around abouts.
+
2006-08-08 Neil Spierling <sirvulcan@gmail.com>
* src/hash.c: Speed up city and country lookups significantly.
{ "OSMSG_WHOIS_POSTAL_CODE","Postal Code : %s" },
{ "OSMSG_WHOIS_LATITUDE", "Latitude : %f" },
{ "OSMSG_WHOIS_LONGITUDE", "Longitude : %f" },
+ { "OSMSG_WHOIS_MAP", "Map : %s" },
{ "OSMSG_WHOIS_DMA_CODE", "DMA Code : %d" },
{ "OSMSG_WHOIS_AREA_CODE", "Area Code : %d" },
{ "OSMSG_WHOIS_MODES", "Modes : +%s " },
reply("OSMSG_WHOIS_POSTAL_CODE", target->postal_code);
reply("OSMSG_WHOIS_LATITUDE", target->latitude);
reply("OSMSG_WHOIS_LONGITUDE", target->longitude);
+ /* Only show a map url if we have a city, latitude and longitude.
+ * Theres not much point of latitude and longitude coordinates are
+ * returned but no city, the coordinates are useless.
+ */
+ if (target->latitude && target->longitude && target->city) {
+ char map_url[MAXLEN];
+ snprintf(map_url, sizeof(map_url), "http://www.mapquest.com/maps/map.adp?searchtype=address&formtype=address&latlongtype=decimal&latitude=%f&longitude=%f",
+ target->latitude, target->longitude);
+ reply("OSMSG_WHOIS_MAP", map_url);
+ }
reply("OSMSG_WHOIS_DMA_CODE", target->dma_code);
reply("OSMSG_WHOIS_AREA_CODE", target->area_code);
} else if (target->country_name) {