CMap Installation Notes: Using CMap is designed to be very easy. I will include some code examples of how to use CMap effectively. There is also an online API documentation at: http://www.brybot.ca/software/CMap/docs 1 - Generating Google and Yahoo Maps: 1.1 - Requirements for Google and Yahoo Maps: For in-page maps, we only have two requirements, we need to include the CMap code and have a
Second Location
'); $location3 = new Location(47.28739597242064, -122.12379002571106, ''); $cmap->addLocation($location1); $cmap->addLocation($location2); $cmap->addLocation($location3); $cmap->setContainer("googleMap"); $cmap->setControlSize(SML_CONTROLS); $cmap->setDisplayType(HYRBID_MAP); $cmap->setKey("Key-From-Google"); $cmap->drawMap(); $cmap->setContainer("yahooMap"); $cmap->setControlSize(LRG_CONTROLS); $cmap->setMapType(YAHOO_MAP); $cmap->setKey("Key-From-Yahoo"); $cmap->drawMap(); ?> This will output a Google Map and a Yahoo Map side by side. The Google Map will have a minimized control interface and default to a hybrid view. The Yahoo Map will have normal (or full) control interface. 2. Generating Google Earth KML Files 2.1 Setup CMap is capable of creating KML files to be directly used in Google Earth. It is very simple but the page needs to be set up for it. CMap generates the KML but does not generate any headers to set the MIME-type of the page. Therefore, the correct code is generated but the web browser will attempt to erroraneously parse it (unless you want to do that). We simply need to include 1 or 2 headers in the Google Earth file: header("Content-Type: application/vnd.google-earth"); will set the MIME-type to a Google Earth KML file, and: header("Content-Disposition: attachment; filename=brybot.kml"); will force the user to download the KML file as brybot.kml 2.2 Example Code: Google Earth File Testit'); $cmap->addLocation($loc); $loc = new Location(49.3441594037696, -123.25507342815399, 'Testit2
'); $cmap->addLocation($loc); $cmap->setMapType(GEARTH_FILE); $cmap->drawMap(); ?> When you link to this php page, it will force the user to download a KML file with your two locations in it and the html in the bubbles. --------------------------------------------- As mentioned before, the full API documentation can be found at: http://www.brybot.ca/software/CMap/docs I welcome any contributors! Send any comments, questions, or BUGS to: Bryan Rite