I’ve now released version 1.0.0-alpha14 with the following change-log;
[1.0.0-alpha14] - 2024-04-23
Added
- Expose the farmOS instance name, version, and system of measurement
- Add support for simple maps using farmOS-map
Fixed
- Cleanup a few minor issues with the documentation
Meta Info Exposed
https://symbioquine.github.io/farmOS_asset_link/IAssetLinkViewModel.html
Map Integration Tutorial
https://symbioquine.github.io/farmOS_asset_link/tutorial-map-integration.html
TestMap.alink.vue
<script setup>
import { createDrupalUrl } from "assetlink-plugin-api";
const onMapInitialized = (map) => {
map.addBehavior("sidePanel");
map.addBehavior("layerSwitcherInSidePanel");
const layer = map.addLayer('geojson', {
title: 'All Assets',
url: createDrupalUrl('/assets/geojson/full/all')
});
layer.getSource().on('change', function () {
map.zoomToVectors();
});
};
</script>
<template alink-route[com.example.farmos_asset_link.routes.v0.test_map]="/test-map">
<farm-map @map-initialized="onMapInitialized"></farm-map>
</template>