Comparison of Google Maps vs Yahoo Maps
Google Maps
Google Maps now supports KML (KeyHole Markup Language) essentially XML, which was previously only supported by . The KML file has to be uploaded to a web server and then the URL has to be provided to Google Maps in order to display it. (Also this support for KML is provided by 3rd party not google ). So the problem with using KML is that URL of the form http://maps.google.com/maps?f=q&hl=en&q=http://www.slac.stanford.edu/comp/net/wan-mon/viper/l.kml&layer=&ie=UTF8&z=17&om=1 will be displayed to the user.
Pros:
- Fluid interface, brilliant looking map marker flyouts
- Largest developer base
- Lots of hacks and how-to's available
- Supports KML which is essentially XML.
Cons:
- Lack of support for Geo Coding Service (which we do not need any way)
Yahoo Maps
Pros:
- Very flexible and open API's.
- Flash Version available.
- Easy to implement.
Cons: - API is not as powerful and flexible as Google Maps.
Examples of Google Maps Features
Icons
The fallowing sample KML will display a place marker at the latitude and longitude supplied to it
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.1"> <Placemark> <name>Simple placemark</name> <description>Attached to the ground. Intelligently places itself at the height of the underlying terrain.</description> <Point> <coordinates>-122.0822035425683,37.42228990140251,0</coordinates> </Point> </Placemark> </kml>
Charts
JFreeChart or any other graphing API can be used to display Router Utilization Graphs. The Graphs can be saved as images and then there URL can be provided to the CallOut to display the graph. Here is a sample code
<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.1"> <Document> <Placemark> <name>CDATA example</name> <description> <\!\[CDATA\[ <h1>Network Utilization Graphs</h1> <img src="http://www.slac.stanford.edu/comp/net/wan-mon/viper/graph.png"></img> \]\]> </description> <Point> <coordinates>102.595626,14.996729</coordinates> </Point> </Placemark> </Document> </kml>
\
Lines
Two draw lines between two points the fallowing code can be used
<Placemark> <name>Polyline 1</name> <description>This is some info aboout polyline 1</description> <Style> <LineStyle> <color>ff00ff00</color> <width>6</width> </LineStyle> </Style> <LineString> <coordinates>-122.1,37.4,0 122.0,-37.4,0 </coordinates> </LineString> </Placemark>
The thickness, color, size and transparency of the line can be adjusted.
Currently I am writing a KMLWriter Class that will have functions for producting all the KML output, so the user will only need to supply the arguments to its functions. Currently the Class has three methods
drawIcon(String title, String description, String latitude, Sting longitude) drawLine(String lat1, String lon1,String lat2, String lon2, String color)