I don't know how to define an export in my custom build. In my map definition I have:
controls: ol.control.defaults({ zoom: false, attribution: false })
.extend([attribution])
But I can't seem to get the "exports" right in my build.json file. When I build I get errors like:
No matching symbol found: ol.control.defaults.extend
In my build.json file I have:
"ol.Attribution",
"ol.control.Attribution",
"ol.control.defaults",
Followed by each of the following, one at a time:
"ol.control#extend",
"ol.control.extend",
"ol.control.defaults#extend",
"ol.control.defaults.extend",
(Obviously the trial-and-error approach) Any clue as to what I'm overlooking? Is "extend" a member of some other object?
Thanks,
Rich
extend is a ol.Collection method, so add this "ol.Collection#extend" to your build.json.
Related
I'm using the rollup plugin strip to exclude the console.logs in the production built with following settings
plugins: [
strip({
include: ['**/*.(js|svelte)'],
labels: ['dev'],
functions: ['console.log'],
})
]
I now have the situation that I would like to keep one special log in production. So I created a function in a new file logInProduction.js
export function logInProduction(msg) {
console.log(msg)
throw new Error('PRODUCTION')
}
and added the file to the plugin options by adding this line
exclude: ['logInProduction.js'],
But when calling the function, the error is thrown, so the function was called, but the log before doesn't appear.
Is this because the .js ending is generally included before so the specific exclusion doen't have any effect? Is it possible to do this?
Or is there another maybe better way to keep one specific console.log?
Problem was, that the filename was missing the directory, so
exclude: ['src/utils/logInProduction.js'],
or
exclude: ['**/logInProduction.js'],
does work
I was wondering if textmate2 can be set to save a file in a .java extension. I'm looking around for such a feature but can't find anything. Can anyone help me out?
Add the following snippet to ~/.tm_properties or to a .tm_properties file in your project.
[ source.java ]
saveOnBlur = true
source.java Refers to the scope of Java code from the official bundle. Your scope could be different, so to answer your question directly: you can do this with file extensions:
[*.java]
saveOnBlur = true
You may find this thread/gist enlightening
I need to use a method that is not marked as #api in OpenLayers 3, i.e. it is not exported in the default minimized build that comes with releases of OpenLayers 3. The method in question is: getTileCoordExtent, of the ol.tilegrid.TileGrid class.
I tried to add "ol.tilegrid.TileGrid#getTileCoordExtent" in the build json configuration, as suggested in the configuration documentation, but I got the following error:
ERR! No matching symbol found: ol.tilegrid.TileGrid#getTileCoordExtent
Does that mean that methods that are not marked as #api can't be exported ? Is there a way to accomplish what I'm trying to do other than editing the code and add the #api myself ?
To borrow Andreas Hocevar's response:
The exports are determined by tasks/generate-exports.js reading symbols from build/info,json. If you want custom symbols, you can add them to the symbols object in info.json, e.g.
{
"symbols": [
{
"name": "ol.tilegrid.TileGrid#getTileCoordExtent",
}
]
}
Of course you should not be doing that, unless you are aware that you have no guarantee that what you add this way will be stable.
Original answer: https://groups.google.com/forum/#!msg/ol3-dev/HwWRoJF0eRU/MYvEa6-aAwAJ
experts out there! I need your help. I am trying to make my own instant messenger. I refer to this website, and I am stuck at this. There is a read underline bottom of the word, 'parse' and it says Cannot resolve symbol parse. I did everything I could. I put parse-1.10.2.zip in libs file. I added compile fileTree(include: ['*.jar'], dir: 'libs'), compile files('libs/Parse-1.10.2.jar') in build gradle, and added the jar in dependencies. However, the error still there. Can anybody fix this problem? Here's my code:
public class MyApplication extends Application {
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
Parse.initialize(this, "APPLICATION ID", "CLIENT KEY");
}
Have you extracted your zip-archive? I'm no expert but you should put the jar-Files into libs-directory - not a zip-file.
Otherwise try this templates:
I tried to use GDSL Scripts for my grails project in IDEA.
I tried things as shown in the Guide: GDSL Guide. The Steps I followed were:
Created a myDef.gdsl file in my project home(i.e. in the folder
that containg grails-app, web-app etc)
In that file i added this code:
def ctx2 = context(ctype: "com.myPackage.MyClass")
contributor(ctx2) {
method(name: 'withLock', type: 'void', params: [closure: { }])
}
Clicked on Activate.
But it still does not show any autocomplete or recognise when I do:
Myclass m = new MyClass()
m.withLock() //This is not recognised
What am I doing wrong??? :(
Details:
Idea Series: Ultimate
Idea Version: 107.535
The GDSL file should be located under some source root. Grails module content roots aren't source roots. So please consider putting it into src/main/groovy, for example.