-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |