KML to Foreflight import - changing icons - overlay

I am working on a kml file of local hospitals to be imported into Foreflight as a user map layer. The points are formatted very simply:
<Placemark>
<name>OHSU</name>
<description>Portland OR (9OR6)</description>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>-122.6854629516602,45.49906158447266,0</coordinates>
</Point>
</Placemark>
Notice there's no styling - in google earth this shows up with the default yellow pin and the name showing. However, once imported into Foreflight it shows up as the default blue triangle pin with no name showing.
I want to keep it with no name showing, but change the color of the icon to red. So, I loaded a file with the red pushpin on a single point and then used that style link to change the placemark to red. Like so:
<Placemark>
<name>OHSU</name>
<styleUrl>#redIcon</styleUrl>
<description>Portland OR (9OR6)</description>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>-122.6854629516602,45.49906158447266,0</coordinates>
</Point>
</Placemark>
where redIcon is defined above:
<Style id="randomColorIcon">
<IconStyle>
<color>"red"</color>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/red-pushpin.png</href>
</Icon>
</IconStyle>
</Style>
but when I do that the description also shows up on the imported points.
I've also tried adding simply a <color>"red"</color> block to the placemark on the line after "name" but that doesn't change the color. Based on Foreflight's reaction I suspect that something about the original bare-bones method of defining the points is breaking something in Foreflight. (I think it intends to show the name always but without a style it won't). Unfortunately I can't find any resources about the Foreflight API and how it actually parses the kml data into it's own triangle placemarks, et c. I've looked for answers on aviation stack exchange as well - no one seems to have this particular problem.
Any thoughts are appreciated. I feel like changing just the icon color without also making the name show up should be simple enough that I'm just overthinking this and missing an easy solution.
UPDATE: testing with this short file of a single icon right now:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="redIcon">
<IconStyle>
<color>ff0000ff</color>
<scale>1.0</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon21.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<color>00ff0000</color>
</LabelStyle>
</Style>
<Placemark>
<name>IconStyle.kml</name>
<styleUrl>#redIcon</styleUrl>
<description>Show me a point</description>
<Point>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>-122.36868,37.831145,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
I have tried changing virtually everything about LabelStyle, and based on foreflight's response, it appears that foreflight doesn't know how to parse LabelStyle separately from IconStyle. Changing the size, color, and opacity of the Label all had zero effect - it stayed the same color as the Icon. I can only conclude that this is a specific quirk of foreflight's API.

As of writing this (November 2019), I have confirmed with foreflight that LabelStyle is not supported. Supported elements are:
- Point
- LineString
- LinearRing
- Polygon
- MultiGeometry
- Style
- StyleMap (only the "normal" style is supported)
- LineStyle
- PolyStyle
- IconStyle
Hopefully this helps anyone else who might run into this problem.

This answer probably comes way too late but I think you might be able to get rid of the labels by adding a scale block with a value of 0.0 in the labelStyle block after the color

Related

SAP UI5: NumericContent: scale is shorted

I am having a problem while using SAP UI5. I am using a NumericContent Tile. Here I want to set "km/h" as a scale, but it always gets abbriged to "km/".
How can I prevent this?
<TileContent footer="{i18nExtended>SpeedTripMax}" class="sapUiSmallMargin">
<content>
<NumericContent value="{mymodel>/SpeedTripMax}"
truncateValueTo="6" scale="km/h"/>
</content>
</TileContent>
I do not know why it is happening, but according to api one should use sap.suite.ui.commons.GenericTile instead of sap.suite.ui.commons.NumericTile because it is deprecated since version 1.25.
Try GenericTile approach.
EDITED 10:42 120717:
I tested it on my system and it is bug, because k/h works fine:
The max string length is just 3 signs:
I was testing it within GenericTile.

How to show checkbox (checked or unchecked) in report

I am using iReport 5.2.0. I'm trying show a parameter as checkbox: checked or unchechecked. How I can solve this task?
Answer by #Kudo
I'm using two images to display checkbox or uncheckbox. In each image, using Image Expression else if. ex: $P{param}.equals("TRUE") ? $P{imagecheck} : $P{imageuncheck}
I'm using a text field with this expression:
$F{b}!=null?"þ":"¨"
and set font: Wingdings.
The first symbol is a checked box, the second is an unchecked box.
So, if I want a check I just send a character from database in field b. If I want a blank box I leave b field null.
... and check this too:
http://jasperreports.sourceforge.net/sample.reference/fonts/
it provides information like "How to ship the required fonts with your report templates when deploying them in the target application, using font extensions."
You do not need to put images to create a checkbox. Just put a 11x11 rectangle. and add 2 pieces of 9x9 lines like "\" and "/" and laminate them(put on top of each other). Make the line at bottom Opaque and right click and send it backward. Make the line at top "not opaque". If not showing one of them true, just play with these back or front settings. Then center those laminated lines into your rectangle. After all you can set print when expression parts by code. thats all!
By the way you can reverse "\" line to "/", by line properties > direction > "bottom up" or "top down" settings. Have a nice day!
Another way is to use unicode ensure your jasper report has an encoding of:
...
<?xml version="1.0" encoding="UTF-8"?>
...
<field name="COLUMN_1" class ="java.lang.Boolean" />
...
<textFieldExpression class="java.lang.String">
<![CDATA[$F{COLUMN_1} ? "\u2713":"\u2717"]]>
</textFieldExpression>
...
Before:
After:

Use KML file to detect Countries (Xcode)

I have a KML file with all the countries and polygons. I am trying to create an app that get a Lat & Lon and detecting in which country belongs using this KML. I tried SimpleKML and KMLViewer with no luck.
The kml structure is:
<Document>
<Folder>
<Folder>
<name>A -</name>
<Placemark>
<name>Afghanistan</name>
<description></description>
<Style>
<PolyStyle>
<color>aaffffff</color>
<colorMode>random</colorMode>
</PolyStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
65.62729644775391,37.33319854736328,0 65.64692687988283,37.45888137817383,0
...
...
coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
<Placemark>
<name>Albania</name>
..
..
..
1) It would be better to use xml parser and save the data on a local database?
2)Is there any function to determine in which polygonal is the given lat/lon ?
Thank you
The parsing should be pretty easy using NSXMLParser, look for names and associate them with coordinates. The more interesting part is to test the polygons for inclusion of a point.
Here's a highly regarded SO article, that looks like it borrows somewhat from this wikipedia article. What you would do is build a collection of polygons, and enumerate them testing each for the inclusion of some given coordinates.
The other thing to think about is to skip the parsing and polygon testing altogether and use the google geocoding api. This section talks specifically about getting address info (including country) from a latitude and longitude.

Set part of the window title to bold

I use ZK (just started learning), and I'd like to set some of the text from my modal window's title to bold.
Here is the code I use :
<?xml version="1.0" encoding="UTF-8"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window apply="hidden-file-name" title="${msg:l('title')}" width="390px" closable="true">
<tablelayout columns="2">
<!-- Some code -->
</tablelayout>
</window>
</zk>
I have already divided title in my .properties file into title and info. I'd like the "info" part to appear in bold.
Just in case, here's an example :
Title : "This is my title"
Info : " and this is the info"
-> I want my modal window to have this title : "This is my title and this is the info".
I found a dirty solution, which is to set the "info" part as a caption, use float: left; to bring it to the left, and alter the css of the "title" part by setting a fixed width to remove the space appearing between the two parts, but as you can see, this is bad.. I'd like something clean.
Add Caption to Window and the position should be by default
[Title here][Caption Here]
so just put the info in the Captions label and set it to bold.
To set different styles to the same label is as far as i know not
possible in zk directly.
Of course you can change it via java script, but this would imho
be overkill in your case.
Edit
See this example. You see that title and caption are both left.
So this is normal.
After I play around a bit, I found a solution. Look here.
You can try override the bind_ function to update the content of title after dom elements rendered by Client Side Programming,
e.g.,
<window border="normal" title="the bold title">
<attribute w:name="bind_"><![CDATA[
function (a, b, c) {
this.$bind_(a, b, c);
var cap = this.$n('cap');
cap.innerHTML = cap.innerHTML.replace('bold', '<span style="font-weight: bold;">bold</span>');
}
]]></attribute>
</window>
Ref:
ZK Client Side Programming

Saving Long/Lat as kml (track)

So, I've got a class with contains a NSMutableArray of CLLocation's, and a name.
Now I want to save them to KML, ideally as a track (or , so I can use the file to display the locations traveled.)
How would I go about this?
I don't expect code, more guidance (I'm new to Objective-C and KML, so got a lot to learn! :) )
I haven't used either of these, but here's a couple of libraries that turned up in a search:
http://github.com/incanus/Simple-KML/
http://developmentseed.org/blog/2010/aug/12/kml-parsing-library-released-apples-ios-platform
Edit: it looks like both those libraries are parsers, not writers. You may have to create your own writer.
I'd say that using either of these libraries would save you a lot of time. That said, have a look at how KML is formed. It's just XML and making a track is really easy. Here's an example:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1" xmlns:trails="http://www.google.com/kml/trails/1.0">
<Document>
<name>RK_Running.kml</name>
<Placemark>
<name>Running 12/9</name>
<Style>
<LineStyle>
<color>ff0000ff</color>
<width>4</width>
</LineStyle>
</Style>
<MultiGeometry>
<LineString>
<tessellate>1</tessellate>
<coordinates>
138.968309,35.716577,17.0
138.967998,35.716859,17.0
138.967526,35.717252,20.0
138.967055,35.717494,20.0
</coordinates>
</LineString>
</MultiGeometry>
</Placemark>
</Document>
</kml>
Save this as a .kml and it will open in Google Earth
KML is just XML. I'd suggest you create something like what you're looking for using Google Earth. Save it as KML and open it with a text editor to get an idea of what you need to output.
You can generate XML using libxml2 or KissXML