User Tools

Site Tools


thinkgeo_cloud_javascript_sdk_quick_start_guide

This is an old revision of the document!


ThinkGeo Cloud JavaScript SDK Quick Start Guide

The ThinkGeo Cloud JavaScript SDK Quickstart Guide will guide you through the process of creating a sample in any web page and will help you become familiar with ThinkGeo Cloud JavaScript SDK.

The purpose of this guide is to help you quickly get started building your own spatially aware web page with ThinkGeo Cloud. Like any new software, there is some learning to be done along the way.

How do we start to learn how to take advantage of the power of ThinkGeo Cloud? The best way is to make a sample application with it.

Create a web page

Let's start with a new web page. Below you'll find a complete working example. Create a new file, copy in the contents below, and open in a browser:

<!doctype html>
<html lang="en">
 
<head>
    <!-- latest minified version of thinkgeocloudclient.js -->
    <script src="https://cdn.thinkgeo.com/cloudclient-js/1.0.0/thinkgeocloudclient.js"></script>
    <title>Cloud Service Sample</title>
</head>
 
<body>
    <h2>My Cloud Service Sample</h2>
    <div id="response"></div>
    <script type="text/javascript">
        var reverseGeocodingClient = new tg.ReverseGeocodingClient('Yy6h5V0QY4ua3VjqdkJl7KTXpxbKgGlFJWjMTGLc_8s~');
 
        // Find the ThinkGeo office address by coordinate
        reverseGeocodingClient.searchPlaceByPoint(33.128367, -96.809847, function (status, response) {
 
            if (response.data.bestMatchLocation) {
                let address = response.data.bestMatchLocation.data.address;
 
                document.getElementById('response').innerHTML = address;
            }
        })
    </script>
</body>
 
</html>

Understanding what is going on

thinkgeo_cloud_javascript_sdk_quick_start_guide.1547704408.txt.gz · Last modified: 2019/01/17 05:53 by johnnyz