Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeisen committed Apr 12, 2017
1 parent d307184 commit a150d63
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 34 deletions.
2 changes: 1 addition & 1 deletion documentation/snippets/language-example.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<blockquote class="lang-specific javascript--node">
<p>You selected the documentation for Node.js library.
The library is deployed under the MIT License and is
available as <a href="https://github.com/Breinify/brein-api-library-node">open-source project</a>
available as <a target="_blank" href="https://github.com/Breinify/brein-api-library-node">open-source project</a>
on GitHub.</p>
</blockquote>

Expand Down
12 changes: 8 additions & 4 deletions documentation/snippets/language-geocoding.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
>
```javascript--browser
var text = 'NYC';
Breinify.temporalData({ additional: { location: {'text': text }}}, function(data) {
// the location will be resolved to San Francisco, CA, US
Breinify.temporalData({ location: { text: 'Bemidji' }}, function(data) {
// the location will be resolved to Bemidji, Minnesota, USA
console.log(data);
});
```
```

<blockquote class="lang-specific javascript--node">
<p>This example is also available on runkit, to try it yourself, see
<a target="_blank" href="https://runkit.com/breinify-stage/geocoding-free-text">runkit (free-text)</a>.</p>
</blockquote>
2 changes: 1 addition & 1 deletion documentation/snippets/language-integrate.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<blockquote class="lang-specific javascript--node">
<p>The library is distributed through Node.js package manager
(<a href="https://www.npmjs.com/package/breinify-node">npm</a>).</p>
(<a target="_blank" href="https://www.npmjs.com/package/breinify-node">npm</a>).</p>
</blockquote>

>
Expand Down
27 changes: 10 additions & 17 deletions documentation/snippets/language-resolve-ip-address.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
<blockquote class="lang-specific javascript--browser">
<p>With the JavaScript library it is really simple to resolve temporal information
based on a client's ip-address. The endpoint utilizes the requesting ip-address to
determine, which information to return. Thus, the call does not need any additional
data.</p>
<p>In general, the ip-address can be simply passed as first parameter. If you
would like to know more about your requesting client, you can also just pass in
the requesting ip-address. There are several different ways (also depending on the
used framework) available to determine your client's ip, for example, see
<a target="_blank" href="https://www.npmjs.com/package/client-ip">client-ip</a>.</p>
</blockquote>

>
```javascript--browser
Breinify.temporalData(function(data) {
breinify.temporalData('72.229.28.185', function(data) {
console.log(data);
});
```

<blockquote class="lang-specific javascript--browser">
<p>Sometimes, it may be necessary to resolve a specific ip-address instead of the client's
one. To specify the ip-address to resolve, the library provides an overriden version, i.e.,</p>
</blockquote>

>
```javascript--browser
var ip = '72.229.28.185';
Breinify.temporalData({ additional: { ipAddress: ip }}, function(data) {
console.log(data);
});
```
<blockquote class="lang-specific javascript--node">
<p>Check the example on runkit, to try it yourself, see
<a target="_blank" href="https://runkit.com/breinify-stage/looking-up-ip-data">runkit (ip-address)</a>.</p>
</blockquote>
44 changes: 33 additions & 11 deletions documentation/snippets/language-reverse-geocoding.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
<blockquote class="lang-specific javascript--node">
<p>To reverse geocode a location it is possible to just pass the latitute and longitude
and use the resolved information.</p>
</blockquote>

>
```javascript--browser
Breinify.temporalData(37.7609295, -122.4194155, function(data) {
console.log(data);
});
```

<blockquote class="lang-specific javascript--node">
<p>In addition, it is possible to request
<code class="prettyprint">GeoJson</code> instances. To do so,
a location must be specified, together with the shapes to return.</p>
</blockquote>

>
```javascript--browser
var loc = {
latitude: 37.7609295,
longitude: -122.4194155,
shapeTypes: ['CITY', 'NEIGHBORHOOD']
latitude: 40.7608,
longitude: -111.8910,
shapeTypes: ['CITY']
};
Breinify.temporalData({ additional: { location: loc }}, function(data) {
/*
* The location will be resolved to San Francisco, CA, US.
* In addition, it will contain the shapes of the
* neighborhood and the city the location points to.
*/
console.log(data);
Breinify.temporalData({ location: loc }, function(data) {
console.log(data);
});
```
```

<blockquote class="lang-specific javascript--node">
<p>There are examples available on runkit. Have a look:
<ul>
<li><a target="_blank" href="https://runkit.com/breinify-stage/reverse-geocoding-lati-long">Coordinations Example</a></li>
<li><a target="_blank" href="https://runkit.com/breinify-stage/reverse-geocoding-geojson">GeoJson Example</a></li>
</ul>
</p>
</blockquote>

0 comments on commit a150d63

Please sign in to comment.