Picture of Fabio Beoni
Interactive Maps, new component
by Fabio Beoni - Wednesday, 28 June 2017, 9:57 AM
 

Hello,

I just published a new component for Adapt, it's the "Interactive Maps - Places": on your course you can create maps and display clickable markers on them, each marker displays other infos about the place.

Feedback is welcome! ;)

Thanks, Fabio.

 



Picture of Matt Leathes
Re: Interactive Maps, new component
by Matt Leathes - Wednesday, 28 June 2017, 10:15 AM
 

That looks really cool!

Could I encourage you to register this plugin so that it appears in the plugin browser? Though before you do, there's a slight name mis-match - in bower.json you're missing the dash from the component name.

Picture of Fabio Beoni
Re: Interactive Maps, new component
by Fabio Beoni - Wednesday, 28 June 2017, 1:42 PM
 

Hi Matt,

thanks for your feedback. I want to register it for sure.

About the difference in the "name" field into the bower.json, changing the name there does that mean I must change the name in JS code too? 

Let's say there:

Adapt.register('adaptInteractiveMapPlaces', component);

 Many thanks, F.

Picture of Matt Leathes
Re: Interactive Maps, new component
by Matt Leathes - Wednesday, 28 June 2017, 2:40 PM
 

Good question!

The first parameter of Adapt.register() is the component name as you want people to use it in components.json as the value for the "_component" property. Typically this would be the shorter version of the name e.g. "mcq" or "confidenceSlider".

The value for the "component" property in bower.json also has to match this I think - certainly it does in all the others I've seen.

I don't think it's essential but typically the convention is to give your main JS file a name that reflects which plugin it belongs to i.e. interactiveMapPlaces.js or adapt-interactiveMapPlaces.js rather than just component.js

Finally, it's worth noting that if you start doing releases then you will have to keep doing releases every time you want to issue updates. Whereas if you register the plugin with no releases and don't subsequently do any, the adapt-CLI will always just take whatever is in MASTER so you don't have to worry about doing releases to get new features/bugfixes out. I think the same thing may apply to tags, I am not sure.

Picture of Fabio Beoni
Re: Interactive Maps, new component
by Fabio Beoni - Wednesday, 28 June 2017, 9:36 PM
 

OK thanks for your comments!

Let's see how the registration goes ;)

Picture of Fabio Beoni
Re: Interactive Maps, new component
by Fabio Beoni - Thursday, 29 June 2017, 1:06 PM
 

Hi Matt,

I just registered the plugin. The CLI says that all was OK ;) but I don't see it in the web site list... Does that take some time?

Thanks.

Picture of Matt Leathes
Re: Interactive Maps, new component
by Matt Leathes - Thursday, 29 June 2017, 2:13 PM
 

Yes, it can take some time to show up in the website - but it will show up in $ adapt search immediately if it has worked. Unfortunately, it doesn't seem to have worked.

I just tried registering our adapt-courseWindowSettings extension as a test - worked fine.

This is what you should be seeing:

registering a plugin

 

All I can suggest is that you double-check you're doing everything correctly using the Wiki as a reference and try again? In particular you must ensure you have a value .bowerrc file - but you don't need to commit this to Git; it's only needed during the registration process, you can just delete it when you're done.

Picture of Fabio Beoni
Re: Interactive Maps, new component
by Fabio Beoni - Thursday, 29 June 2017, 3:30 PM
 

Thanks for help.

I actually got the message that the registration was completed successfully :(

I will try again.

Picture of Matt Leathes
Re: Interactive Maps, new component
by Matt Leathes - Thursday, 29 June 2017, 4:46 PM
 

Yes, well that's clearly a bug! I'll log an issue for it...

Picture of Fabio Beoni
Re: Interactive Maps, new component
by Fabio Beoni - Thursday, 29 June 2017, 3:49 PM
 

Hi Matt,

was all about having that file in the root of the component. Thanks for  your suggestion.

Actually I had it in a previous version of the project, I think I deleted it by mistake and I didn't notice that because it was not committed to github!  ;)

Thanks again.

Picture of Matt Leathes
Re: Interactive Maps, new component
by Matt Leathes - Thursday, 29 June 2017, 4:46 PM
 

Yep - I can see it now. Great stuff, thanks for persevering.