...
Code Block | ||
---|---|---|
| ||
<html> <head> <script src="https://dev-meglerpakke.ambita.com/package/mflex.umd.js" charset="utf-8"></script> </head> <body> <h1> Welcome to Ambita Infoland components! </h1> <div id="search" style="height: 75px"></div> <div id="product-list"></div> <button id="confirm">Confirm order</button> <script> document.addEventListener('DOMContentLoaded', () => { window.Ambita.mFlex.init({ environment: 'beta', token: { access_token: '74246ace-f71f-423f-951a-8a9816a3319a', token_type: 'Bearer', expires_in: 3600, refresh_token: '80194947-73f6-47f6-92ca-66803abb7686', scope:['infoland.flex'], expires_at: '2022-09-27T07:47:49.774Z' }, reference: 'test' }); window.Ambita.mFlex.search.onSearchResult = (result) => { console.log(result); }; window.Ambita.mFlex.search.load('#search'); window.Ambita.mFlex.productList.load('#product-list', { share:{}, cadastre:{ knr: '0301', gnr: '224', bnr: '64', snr: '18' } }); const confirmButton = document.getElementById('confirm'); confirmButton.addEventListener('click', async () => { const orderNumber = await window.Ambita.mFlex.productList.confirmOrder(); console.log(orderNumber); }); }); </script> </body> </html> |
...
Component set up
...
.
Ambita.mFlex.
...
receipt
This is used for configuration and injection of the components
Example
...
language | typescript |
---|
...
function will load the receipt component. Which shows current status about the products, the propertydata the documents were ordered on. As well as the possibility to download the files on the product.
You get the order number from this function: Ambita.mFlex.productList.confirmOrder
Code Block |
---|
window.Ambita.mFlex.receipt.load('query-selector', <order number>); |
Additional components set up
Ambita.mFlex.init
This is used for configuration and injection of the components
Example
Code Block | ||
---|---|---|
| ||
window.Ambita.mFlex.init({
environment: 'beta',
token: tokenObject,
reference: '123456789',
technicalReference: '123456789',
externalDepartmentId: 1234,
}); |
...
Code Block |
---|
{ "itemKeys": { "cadastre": "123-1-1-0-0", "address": "123-12345-12-A" }, "productsQuery": "cadastre=123-1-1-0-0&address=123-12345-12-A", "cadastre": { "title": "0123/1/1/0/0", "id": "123-1-1-0-0", "ident": { "municipalityNumber": 123, "cadastralUnitNumber": 1, "unitNumber": 1, "leaseholdUnitNumber": 0, "sectionNumber": 0, "leasehold": false, "section": true }, "cadastre": { "knr": 123, "gnr": 1, "bnr": 1, "fnr": 0, "snr": 0 }, "subtitle": "Gateadresse 1A", "geojson": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 263267.79, 6651901.69 ] }, "properties": { "id": "123-1-1-0-0", "title": "123/1/1/0/0", "icon": "cube", "type": "group" }, "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::25833" } } }, "addressesLink": "https://beta-api.ambita.com/realty/v1/cadastres/123-1-1-0-0/addresses/", "ownersLink": "https://beta-api.ambita.com/realty/v1/cadastres/123-1-1-0-0/owners/", "links": { "self": { "rel": "Cadastre", "href": "https://beta-api.ambita.com/realty/v1/cadastres/123-1-1-0-0" }, "cadastre": { "rel": "Cadastre", "href": "https://beta-api.ambita.com/realty/v1/cadastres/123-1-1-0-0" }, "owners": { "rel": "Person", "href": "https://beta-api.ambita.com/realty/v1/cadastres/123-1-1-0-0/owners/" }, "addresses": { "rel": "Address", "href": "https://beta-api.ambita.com/realty/v1/cadastres/123-1-1-0-0/addresses/" } }, "isRegisteredLand": true, "isHistoricalRegisteredLand": false, "isTechnicalRegisteredLand": true, "isHistoricalTechnicalRegisteredLand": false } } |
Ambita.mFlex.receipt
This function will load the receipt component. Which shows current status about the products, the propertydata the documents were ordered on. As well as the possibility to download the files on the product.
You get the order number from this function: Ambita.mFlex.productList.confirmOrder
Code Block |
---|
window.Ambita.mFlex.receipt.load('query-selector', <order number>); |
Feature request
If you have any feature requests, please contact us on AmbitaTeamInfoland@ambita.com
...