Attempting to use a leaflet map for the first time ...
Wondering how to add a link to a leaflet's pop-up window?
I've tried doing something like this:
var marker = L.marker([34.063298, -118.280126]) .addTo(map).bindPopup("<b>Blah blah Village</b>Test").openPopup();
Clearly, it doesn't work.
How do I add a simple link? Or even an image?
Thanks.
Your problem is quotes.
"<b>Blah blah Village</b>Test"
This is a string
"<b>Blah blah Village</b><a href="
And then some text, and then the string
">Test</a>"
To fix the issue, you would use different quotes for inner versus outer.
"<b>Blah blah Village</b><a href='http://www.cnn.com'>Test</a>"
Using your debug extensions would help you track this issue down faster.
Related
Inspired by IntelliJ's 3 panel merge conflict view, I am trying to build something similar for vscode. I figured out, that I can integrate three complete customizable monaco-editors within a vscode Webview. But I cannot figure out, how monaco-editor applies the line padding in its diff-view like in the picture below (as I don't want to have a two-way but a 3-way diff using the internal diff-view is not an option for me):
Is it done through custom lineNumbers: lineNumber => isPaddingLine ? '' : lineNumber - someOffset, and inserting empty lines ("padding lines") at the related place and apply a deltaDecorations to those lines?
I hope there is a more easy way, which does not need the "padding lines" hack. Ideally I could just add something to a deltaDecoration like padding-bottom: $Xem
If I have just overlooked a way with vscode's api to achieve something like that, that would be of course more welcome than to deal directly with monaco-editor.
Thx a lot for any help / ideas :)
I finally found it :) IViewZone is the used magic.
And https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-listening-to-mouse-events is a nice example
I am a ionic beginner, and I really do not know how to compare a var in *ngIf.
I have a user class, and one of its atribute is averageRating, that is a Number. In my rating.page.html I can show it like this:
{{user.averageRating}} but I want to show it in a more natural way, with stars.
I know I can not compare like this: *ngIf="{{user.averageRating}}>=1"
So I have try to declare a public ratingActual: Number in my class RatingPage in my rating.page.ts and asign value in the constructor:
this.ratingActual = this.user.averageRate;
And I do in my html: *ngIf="ratingActual>=1"
But is not working. However if I change this.user.averageRate by a number it works.
I would like to understand wy is not working and find an solution, an easy one if it is posible.
Thanks in advance!
I'm working on the Extjs 4 TreeGrid (Ext.tree.TreePanel) and I'd like to manipulate its columns, add and remove them, I searched for something like that in the forum and on google but I can't find anything. Could someone help me with this ?
You can use the methods removeChild and appendChild.
s.th. like this:
node.appendChild({
text:"newNode",
leaf:true
});
I have a map where I have multiple pushpins, and would like the infobox to support HTML content. I'm using the native infobox class, and while I have used a custom infobox, as many have suggested, I'd like to figure this one out.
The code is at: http://brickenandassociates.com/bm.php
Its not compressed or encoded, so you can just view the source.
at line 84, the options for the Infobox are set. In the description, I've tried setting a var , but am missing the syntax somewhere. Something like this :
var ibDescription = document.getElementById('ibDescription');
ibDescription.innerHTML = e.target.description;
Any guidance would be most appreciated !
Looks like you've figured this out already:
pinInfobox.setOptions({title: e.target.Title, description: e.target.Description, visible:true, offset: new Microsoft.Maps.Point(0,25)});
pinInfobox.setLocation(e.target.getLocation());
One thing I noted was that you are only using one InfoBox. I use one info box per pushpin, so I set the infobox detail at the time it is created and then only have to hide or show it.
I've read about wicket:message here, but can't seem to make it do everything I'd like.
Say I have a HTML page with <wicket:message key="text"/> and a properties file containing text=Blah blah: important point, foo bar. I'm wondering how to make part of the text bold (or apply arbitrary CSS to it), to achieve output like:
Blah blah: important point, foo bar
Note that none of this is actually dynamic, so I wouldn't want to do anything in Java, if that can be avoided.
I've tried nesting tags with something like the following, but no luck.
<wicket:message key="text">
<span class="bold"><wicket:message key="text2"/></span>
</wicket:message>
text=Blah blah: ${text2}, foo bar
text2=important point
Is this even possible in Wicket without 1) injecting the formatted part from Java side or 2) just splitting the text into (in this case) three different properties?
The easiest way is to put the tags inside your localization file:
text=Blah blah: <strong>text2</strong>, foo bar
You could also use a Label and a ResourceModel to replace it later:
text=Blah blah: [b]text2[/b], foo bar
And in your model getObject(), or in your Label:
string.replace("[b]", "<strong>");
string.replace("[/b]", "</strong>");
Or, even better, try to reuse a Markdown implementation in your Label.
I've managed to do this for my own application, albeit with a rather ugly hack. I did it by exposing a customized version of WicketMessageResolver.
Here's what to try:
Wholesale copy and paste org.apache.wicket.markup.resolver.WicketMessageResolver into your own class (say com.acme.CustomWicketMessageResolver) (the hack begins!)
Inside your CustomWicketMessageResolver change
WicketTagIdentifier.registerWellKnownTagName( "message" ); to something else like WicketTagIdentifier.registerWellKnownTagName( "msg" );.
Inside of
private void renderMessage(final MarkupStream markupStream, final ComponentTag openTag, final String key, final String value), you'll find the line getResponse().write( text );.
Immediately before that line you have the opportunity to screw around with the value of "text". There, I do something like text = MyLabelUtils.replaceWikiMarkup(text) which post-processes some wiki-like markup syntax used by the content authors for my application.
For example, I use this method to take a Label using a ResourceModel pointing to the key:
propertyKey=I found the answer on [acronym SO].
and a render it as
I found the answer on <acronym title="Stack Overflow">SO</acronym>.
and that method handles i18n and all that fun stuff.
You can, of course, extend that wiki syntax (or anything similar) to be as simple or complex as you'd need.
Note that you'll have to change <wicket:message key='foo'> to <wicket:msg key='foo> in all of your markup files (or at least in ones where you want this behaviour).
I'd obviously prefer a more standard way to customize the behaviour of the built-inwicket message resolver, but if you need this functionality in a pinch, like I did, this will work for now.
If you need something more standard, you could raise the issue on the Wicket mailing list. It's pretty good.
Starting from Wicket 1.4 you can nest components within a wicket:message element. For example:
<wicket:message key="myKey">
This text will be replaced with text from the properties file.
<span wicket:id="amount">[amount]</span>.
<a wicket:id="link">
<wicket:message key="linkText"/>
</a>
</wicket:message>
Then
myKey=Your balance is ${amount}. Click ${link} to view the details.
linkText=here
and
add(new Label("amount",new Model("$5.00")));
add(new BookmarkablePageLink("link",DetailsPage.class));
Results in:
Your balance is $5.00. Click here to view the details.
So maybe, nesting <wicket:message>s without a component could work as well. Not sure.
Source: https://cwiki.apache.org/confluence/display/WICKET/Wicket%27s+XHTML+tags#Wicket%27sXHTMLtags-Elementwicket%3Amessage