Skip to content

Commit

Permalink
release 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elias75015 committed Oct 4, 2022
2 parents fc92cab + 4227e8f commit 64c4e20
Show file tree
Hide file tree
Showing 37 changed files with 1,384 additions and 2,221 deletions.
10 changes: 5 additions & 5 deletions DRAFT_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Bibliothèque d'accès aux services Géoportail, version 3.1.0
# Bibliothèque d'accès aux services Géoportail, version 3.2.0

**23/03/2022 : 3.1.0**
**04/10/2022 : 3.2.0**

> release of geoportal access library
## Summary

Mise à jour vers le service de Geocodage V2

## Changelog

* [Added]

* [Changed]

- utilisation du service d'isochrone v2 (#70)
- utilisation du service de geocodage v2 (#71)

* [Removed]

* [Fixed]

- fix coquille chemin vers GpServices dans le tutorial getconfig local

* [Deprecated]

* [Security]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ La fonction [Gp.Services.getAltitude()](http://ignf.github.io/geoportal-access-l

``` javascript
Gp.Services.getAltitude({
apiKey : "carte", // clef d'accès à la plateforme
apiKey : "altimetrie", // clef d'accès à la plateforme
positions : [ // positions pour le calcul alti
{ lon: 2.29, lat: 48.85 },
{ lon: 2.3, lat: 48.9 },
Expand Down
Binary file added geoportal-access-lib-3.1.0.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "geoportal-access-lib",
"version": "3.1.0",
"date": "23/03/2022",
"version": "3.2.0",
"date": "04/10/2022",
"description": "French Geoportal resources access library",
"module": "src/Gp.js",
"main": "dist/GpServices-src.js",
Expand Down
154 changes: 154 additions & 0 deletions samples-src/pages/Geocode/pages-geocode-bundle-custom-option.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{{#extend "layout-sample-bundle"}}

{{#content "head"}}
<title>Service de geocodage</title>
{{/content}}

{{#content "style"}}
<style>
#optionUser {
width: 400px;
height: 500px;
float: left;
}
#optionOldGeocode {
width: 400px;
height: 500px;
float: left;
}
#optionNewGeocode {
width: 400px;
height: 500px;
float: left;
}
#optionObject {
width: 390px;
overflow: auto;
height: 383px;
}
#oldCode {
overflow: scroll;
height: 406px;
}
#newCode {
overflow: scroll;
height: 406px;
}
#resultDiv {
float: left;
width: 100%;
}
textarea {
resize: none;
}
</style>
{{/content}}

{{#content "body"}}
<h1>Paramétrage du Service de geocodage</h1>

<h4>Indexes et filtres:</h4>
<pre>
- CadastralParcel
* identifiant
* codeDepartement
* codeCommune
* nomCommune
* codeCommuneAbs
* codeArrondissement
* section
* numero
* feuille
- PositionOfInterest
* type
* postalCode
* inseeCode
- StreetAddress
* city
* postalCode
* inseeCode
</pre>
<div id="optionUser">
<h3>Ecrire ici l'objet de paramétrage du service:</h3>
<p>var option =</p>
</br>
<textarea id="optionObject">
{
"index" : "CadastralParcel",
"filters": {
"departmentcode": 75
},
"returnTrueGeometry": "true",
"query": "75102000AO0020"
}</textarea>
</div>

<div id="optionOldGeocode">
<h3>Exemple de paramètrage de l'ancien service:</h3>
<p>var option =</p>
<div id="oldCode">
<pre>
<code>{
"apiKey" : "jhyvi0fgmnuxvfv0zjzorvdn",
"filterOptions" : {
"type" : ["PositionOfInterest"],
"postalCode" : "41290"
},
"position": {
"x" : 1.3,
"y" : 47.8
},
"location" : "Saint-Mandé",
"maximumResponses" : 1
}
</code>
</pre>
</div>
</div>
<div id="optionNewGeocode">
<h3>Exemple de paramètrage du nouveau service:</h3>
<p>var option =</p>
<div id="oldCode">
<pre>
<code>{
"index" : "StreetAddress",
"maximumResponses": 1,
"returnTrueGeometry": "true",
"filters": {
"postcode": 94160,
"citycode": 94
},
"query" : "73 avenue de paris, 94160 Saint-Mandé"
}
</code>
</pre>
</div>
</div>

<div id="resultDiv">
</br>
<button type="button" id="geocodeButton">GO!</button>
</br>
</br>
<h3>Resultat retourné par Gp.Services.geocode(options):</h3>
</div>
{{/content}}

{{#content "js"}}
var geocodeAction = function () {
var optionText = document.getElementById("optionObject").value;
var optionObject = JSON.parse(optionText);

optionObject.onSuccess = function (response) {
print(response.locations);
};
optionObject.onFailure = function (error) {
print(error);
};

Gp.Services.geocode(optionObject);
};

document.getElementById("geocodeButton").onclick = geocodeAction;
{{/content}}
{{/extend}}
65 changes: 52 additions & 13 deletions samples-src/pages/Geocode/pages-geocode-bundle-default.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,66 @@
<h1>Utilisation du Service de geocodage</h1>
<h2>Avec les paramètres obligatoires seulement</h2>
<pre>
<code>
var options = {
apiKey : "{{ apikey }}",
onSuccess : function (response) {
print(response.locations);
},
location : "2 avenue de paris, 94166 Saint-Mandée"
};
Gp.Services.geocode(options);
</code>
<code>
var options = {
index : "CadastralParcel", // CadastralParcel, PositionOfInterest, StreetAddress
// maximumResponses: 1,
// returnTrueGeometry: true,
filters: {
type: "CadastralParcel", // CadastralParcel, PositionOfInterest, StreetAddress
departmentcode: 75,
},
onSuccess : function (response) {
print(response.features);
},
onFailure : function (error) {
print(error);
},
// query : "73 avenue de paris, 94160 Saint-Mandé"
query : "75102000AO0020"
};
Gp.Services.geocode(options);
</code>
</pre>
{{/content}}

{{#content "js"}}
var options = {
apiKey : "{{ apikey }}",
// maximumResponses: 1,
// returnTrueGeometry: true,
index : "CadastralParcel", // CadastralParcel, PositionOfInterest, StreetAddress
filters: {
// postalCode: 94160,
departmentcode: 75,
},
onSuccess : function (response) {
print(response.locations);
print(response);
},
onFailure : function (error) {
print(error);
},
location : "2 avenue de paris, 94166 Saint-Mandée"
// query : "73 avenue de paris, 94160 Saint-Mandé"
query : "75102000AO0020"
};

//test patch ancien formalisme
//var options = {
// apiKey : "{{ apikey }}",
// onSuccess : function (response) {
// print(response.locations);
// },
// filterOptions : {
// type : ["PositionOfInterest"],
// postalCode : "41290"
// },
// position: {
// x : 1.3,
// y : 47.8
// },
// location : "Saint-Mandé",
// maximumResponses : 1
//};

Gp.Services.geocode(options);
{{/content}}
{{/extend}}
51 changes: 0 additions & 51 deletions samples-src/pages/Geocode/pages-geocode-bundle-post.html

This file was deleted.

11 changes: 6 additions & 5 deletions samples-src/pages/Geocode/pages-jsfiddle.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ <h2>Utilisation de Gp.Services.geocode() avec options de filtrage <a href="http:
</p>
<p>Type de Géocodage :
<select id="type">
<option value="PositionOfInterest">Toponymes</option>
<option value="StreetAddress">Adresses</option>
<option value="CadastralParcel">Parcelles Cadastrales</option>
<option value="poi">Toponymes</option>
<option value="address">Adresses</option>
<option value="parcel">Parcelles Cadastrales</option>
</select>
</p>
</div>
Expand All @@ -72,12 +72,13 @@ <h2>Utilisation de Gp.Services.geocode() avec options de filtrage <a href="http:
var location = document.getElementById("location").value;
var fo = {};
if (filterProp && filterValue) fo[filterProp] = filterValue;
fo.type = [document.getElementById("type").options[typeIdx].value];
var index = [document.getElementById("type").options[typeIdx].value];
try {
Gp.Services.geocode({
apiKey: "{{ apikey }}",
index: index,
location: location,
filterOptions: fo,
filters: fo,
onSuccess: function(result) {
resultDiv.innerHTML = "<p>" + JSON.stringify(result) + "</p>"
},
Expand Down
Loading

0 comments on commit 64c4e20

Please sign in to comment.