How can I use leaflet-extra/leaflet-providers with ngx-leaflet. A simple example would be nice. I installed leaflet, #types/leaflet, ngx-leaflet, leaflet-providers, #types/leaflet-providers, but I cannot figure out how exactly to link ngx-leaflet with tileLayer.providers('ProviderId'). there should be an .addTo(???map???) call. Thanks.
If you need access to the map reference, you can follow the instructions here: https://github.com/Asymmetrik/ngx-leaflet#getting-a-reference-to-the-map
There's also a guide with a bunch of examples of how to integrate Leaflet plugins located here: https://github.com/Asymmetrik/ngx-leaflet-tutorial-plugins
It sounds like with this example, you would use the providers plugin to create layers that you'd add to the layers array you are providing to the leafletLayers input binding or the leafletLayersControl input binding.
You'd just need to create the layers and add them to the appropriate array or object.
If you can provide some more specific example code I can give you more detail.
Related
I want to use the variable in https://code.visualstudio.com/docs/editor/variables-reference#_predefined-variables in the vscode extension source code.
How can I get the access to them? Anyone know it?
There is no direct method to get them on official website or github.
I don't think there is any api access to the built-in variable resolver. You will have to make your own. Here is a good example from another extension Commands:
https://github.com/usernamehw/vscode-commands/blob/master/src/substituteVariables.ts
Currently in our project we have layered architecture implemented in following way where Controller, Service, Repository are placed in the same package for each feature, for instance:
feature1:
Feature1Controller
Feature1Service
Feature1Repository
feature2:
Feature2Controller
Feature2Service
Feature2Repository
I've found following example of arch unit test where such classes are placed in dedicated packages https://github.com/TNG/ArchUnit-Examples/blob/master/example-junit5/src/test/java/com/tngtech/archunit/exampletest/junit5/LayeredArchitectureTest.java
Please suggest whether there is possibility to test layered architecture when all layers are in single package
If the file name conventions are followed properly across your project, how about you write custom test cases instead of using layeredArchitecture().
For Example:
classes().that().haveSimpleNameEndingWith("Service")
.should().onlyBeAccessed().byClassesThat().haveSimpleNameEndingWith("Controller")
noClasses().that().haveSimpleNameEndingWith("Service")
.should().accessClassesThat().haveSimpleNameEndingWith("Controller")
I know this question is rather old. But for the record, this has been possible for a while using predicates for the layers, e.g.
layeredArchitecture().consideringAllDependencies()
.layer("Controllers").definedBy(HasName.Predicates.nameEndingWith("Controller"))
.layer("Services").definedBy(HasName.Predicates.nameEndingWith("Service"))
.layer("Repository").definedBy(HasName.Predicates.nameEndingWith("Repository"))
.whereLayer("Controllers").mayNotBeAccessedByAnyLayer()
.whereLayer("Services").mayOnlyBeAccessedByLayers("Controllers")
.whereLayer("Repository").mayOnlyBeAccessedByLayers("Services")
However, I'm not sure how well this works in practice. Because usually you don't just have classes following this naming pattern and that's it. A service might also have some POJO as method parameter type (e.g. MyInput) and that should maybe for example not be used by repositories as well. Also, using forward dependency rules (mayOnlyAccessLayers(..)) this might then cause unwanted violations.
I have a custom XML format that links to Java resources. For the sake of simplicity let's assume my XML file would look like this:
<root>
<java-class>my.fully.qualified.class.name</java-class>
</root>
Eventually my references will be somewhat more complicated. It will not contain the fully qualified class name directly and I will need some logic to resolve the correct class, but I want to keep the example as simple as possible here.
Now I want it to be possible to Strg+Click on the element's text and want IntelliJ to carry me to the .java file, just like it is possible in Spring-XML files. In the IDEA Plugin Development FAQ there is a link called "How do I add custom references to Java elements in XML files?" which so much sounds like exactly what I need. Unfortunately it links to a discussion where someone is more or less done implementing something like this, having some minor problems. Nevertheless I understood that I probably need to write an implementation of the interface com.intellij.psi.PsiReference. Googling for "PsiReference" and "IntelliJ" or "IDEA" unfortunately did not bring up any tutorials on how to use it, but I found the class XmlValueReference which sounds useful. Yet again googling for "XmlValueReference" did not turn up anything useful on how to use the class. At least the PSI Cookbook tells me that I can find the Java class by using JavaPsiFacade.findClass(). I'd be thankful for any tutorials, hints and the like, that tell the correct usage.
The above linked discussion mentions that I need to call registry.registerReferenceProvider(XmlTag.class, provider) in order to register my provider once I eventually managed to implement it, but of which type is "registry" and where do I get it from?
First of all, here's a nice tutorial that came up a few days ago, which explains the basics of IntelliJ plugin development (you should take a look at the section Reference Contributor).
You will likely have to define your own PsiReferenceContributor, which will be referenced in your plugin.xml like this:
<psi.referenceContributor implementation="com.yourplugin.YourReferenceContributor"/>
In your reference contributor, there's a method registerReferenceProviders(PsiReferenceRegistrar) where you will be able to call registry.registerReferenceProvider(XmlTag.class, provider).
Finally, in your instance of PsiReferenceProvider, you will have to test the tag name to filter out tags which don't contain class references, then find the right Java class using JavaPsiFacade.findClass().
From my experience, the best place to get help regarding IntelliJ plugin development is JetBrains' forums.
I would like to provide custom definitions for financial terms (in different languages) in my application using the UIReferenceLibraryViewController, which was introduced in iOS 5.
However, I have not found any information on how to add custom definitions to the reference.
Do you have any suggestions on how to implement this useful feature?
From the documentation:
It should not be used to display wordlists, create a standalone dictionary app, or republish the content in any form.
So, you won't be able to add new definitions.
A quick search on github gives some dictionary sample apps that could be a starting point. See : http://github.com/mattneary/Etymology-for-iPhone or http://github.com/ioseb/LinGEO
Im building a custom generator for my app where I basically want to wrap around the Rails model generator. More specifically, I just want to change the model template being used (I want to add some methods that each model must implement).
Any pointers to the template to override or any other suggestions would be much appreciated.
EDIT:
Just to add, I dont want this to be the default model template, I want to be able to use it only when I use my generator
Some more mucking around and i found the answer. The active record model generator is here