Getting Started
With our API, you can get your first Gothere application up and running in 1 simple step. The API allows you to embed a map on your own website, along with most of the services found on our website. Some knowledge of HTML
and Javascript
is required to use the API.
These steps should help clarify what it takes to get started with our API. Please let us know if you need any help.
-
The "Hello World" example
The simplest way to start using the Gothere Maps API is to see a simple example. The following web page displays a 500 x 300 map centered on City Hall MRT Station.
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>gothere.sg - API Examples - Basic map</title> </head> <body> <div id="map" style="width:500px;height:300px;"></div> <script type="text/javascript" src="http://gothere.sg/jsapi?sensor=false"> </script> <script type="text/javascript"> gothere.load("maps"); function initialize() { if (GBrowserIsCompatible()) { // Create the Gothere map object. var map = new GMap2(document.getElementById("map")); // Set the center of the map. map.setCenter(new GLatLng(1.362083, 103.819836), 11); // Add zoom controls on the top left of the map. map.addControl(new GSmallMapControl()); // Add a scale bar at the bottom left of the map. map.addControl(new GScaleControl()); } } gothere.setOnLoadCallback(initialize); </script> </body> </html>
Save the above code snippet into a
HTML
file or download it to your local computer. That's all you have to do for your first map! Wasn't that easy? -
Explore the possibilities
Check out the examples, and read through the API reference.
-
Get help
Visit our developer forum and take part in the discussions!
-
Show us your awesome work
After you have coded up your awesome application, let us know! We are always on the lookout for fun and creative uses of our API.