Drug Detection Chart Google Apis

Setup
There is only one JavaScript document essential for you to start utilising the Google Map API. Unlike other APIs, you can't download the documents locally. Instead, you'll require to get access to the document established on the Google Map server. This document should encompass the type and your key in this format:
Next, you require to conceive an locality in which to location the map. To manage so, location and method a tag in order that it is established where you'd like the chart to appear. There are then two steps that require to be completed: conceiving a GMap object and centering the chart on an primary point. Each of these steps is amazingly easy.
Suppose you have a with an ID of "divMap", you can conceive a GMap object like this:
var oMap = new GMap(document.getElementById("divMap"));
This step vitally initializing the chart control. At this issue, though, not anything is brandished in the chart area; you require to give it an primary set of coordinates to center on. To manage so, use the centerAndZoom() procedure, with acknowledges two arguments: the GPoint object to center on and the zoom level.
A GPoint object comprises the latitude and longitude geocodes for a exact position in the world. To conceive new GPoint object, just overtake in the coordinates:
var oPoint = new GPoint(iLat, iLong);
This issue can be passed in to centerAndZoom(), along with a zoom grade, to set the primary brandish of the chart (you require to identify both a center and a zoom grade primarily, after that you can change just one or the other if necessary). The zoom grade is an integer between 0 and 17, where 0 is street-level and 17 is world-level.
The center of the United States can be granted as latitude -92 and longitude 32 (somewhere round Kansas City, Kansas), and all of the homeland can be glimpsed at zoom grade 14, so the next cipher will setup the chart to outlook this area:
oMap.centerAndZoom(new GPoint(-92, 32), 14);
Controls
You may have observed that the preceding chart had no way for the client to command what was being displayed. The normal Google Map interface has a number of distinct modes the client can control the chart, and these are accessible to you as well as controls.
Controls are utilized to permit the client to zoom or else control the brandish of the map. There are four built-in controls that can be used:
GLargeMapControl - the usual pan/zoom command brandished on the google map site.
GSmallMapControl - a lesser type of the preceding command, with only plus/minus and directional controls (but no zoom slider).
GSmallZoomControl - the zoom slider command without any directional controls.
GMapTypeControl - the Map/Satellite/Hybrid control.
One or more of these controls can be supplemented to the chart by the addControl() method. Each of the controls can easily be conceived without any parameters and passed in like this:
oMap.addControl(new GSmallMapControl());
Though you'll most often manage this just after conceiving a GMap object, you can add controls at any point. Additionally, you eliminate controls utilising the removeControl() procedure if you have a quotation to the control:
var oControl = new GSmallMapControl();
oMap.addControl(oControl);//do some other stuff
oMap.removeControl(oControl);
The first three controls, GLargeMapControl, GSmallMapControl, and GSmallZoomControl should not be utilized simultaneously since they all live at the identical position on the chart (upper left corner). The GMapTypeControl can securely be utilized with any of the other ones, since it lives at the top right corner.
If you desire your chart to have controls right from the onset, you should add them directly after conceiving the GMap() object but before you call centerAndZoom(), such as:
var oMap = new GMap(document.getElementById("divMap"));
oMap.addControl(new GSmallMapControl());
oMap.addControl(new GMapTypeControl());
oMap.centerAndZoom(new GPoint(-92, 32), 14);


drug detection chart google apis