Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GeoJsonCatalogItem example #4

Open
jonathanpascoe opened this issue Jun 29, 2022 · 3 comments
Open

Add GeoJsonCatalogItem example #4

jonathanpascoe opened this issue Jun 29, 2022 · 3 comments

Comments

@jonathanpascoe
Copy link

Any chance you can provide a user drawn rectangle to GeoJsonCatalogItem example @na9da? I was hoping to do so but was presented with an error when attempting to init GeoJsonCatalogItem after importing from import GeoJsonCatalogItem from "terriajs/lib/Models/Catalog/CatalogItems/GeoJsonCatalogItem".

ERROR in ./packages/terriajs-plugin-markup/node_modules/terriajs/lib/Models/Catalog/CatalogItems/GeoJsonCatalogItem.ts 21:2
Module parse failed: Unexpected token (21:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| class GeoJsonCatalogItem
|   extends GeoJsonMixin(CreateModel(GeoJsonCatalogItemTraits))
>   implements HasLocalData {
|   static readonly type = "geojson";
|   get type() {
 @ ./packages/terriajs-plugin-markup/dist/index.js 1:68-162 1:890-891
 @ ./plugins.ts
 @ ./index.js
 @ ./entry.js

Thanks in advance for the support!

@na9da
Copy link
Collaborator

na9da commented Jul 1, 2022

Hi @jonathanpascoe ,

Thanks for your interest :)

The error you got is likely if your terriamap and your plugin repo depends on different versions of terriajs, so you might want to check that.

I have created a branch which modifies the example to create a GeoJsonCatalogItem instead of box drawing - #5. Now that the plugin branch has been merged to the main terriamap branch, I have updated the instructions to set up the plugin dev environment. Let me know if it works for you.

While you use it, please note that this is a very alpha experiment. It is a bit painful to set up all the dependencies correctly and the build has plenty of type errors. We hope to improve the experience in the future.

Also, if you are ok with it, we are keen to learn any use-cases you might have for terria plugins.

@jonathanpascoe
Copy link
Author

Thanks @na9da for the quick example and issue breakdown. The use-case is pretty straightforward. I was just experimenting with some generic geojson markup tools. Here's a video capture of where I'm at after applying a few tweaks based on your geojson catalog item example. I'll probably hijack the dialog and add some generic title/description input form elements to it.

terria_markup

@na9da
Copy link
Collaborator

na9da commented Jul 3, 2022

Ah looks nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants