Google Map API [폐쇄] 라인 및 다각형 변경
-
14-11-2019 - |
문제
다음과 같이하십시오 : http://www.birdtheme.org/useful/GoogleTool.html 그러나 나는 선을 바꾸고 내가 선택한 색깔의 뇌졸중을주고 싶다.
해결책
The color and the thickness of the lines are defined by the <LineStyle> node in the resulting KML file. You can easily change them.
<LineStyle><color>660000FF</color><width>0.1</width></LineStyle>
Just remember that the encoding of the four hex bytes for the color is a bit unusual: Alpha, B, G, R
So 660000FF is Red (#FF on position 4) with an alpha-transparency of about 26% (#66 on position 1).
The KML reference with all the details can be found here:
https://developers.google.com/kml/documentation/kmlreference
The Birdtheme Google Maps tool (your link) allows you to directly play around with the LineStyles by simply clicking the "Style options" button!
EDIT:
If you need multiple outlines around a polygon path (i.e. highway style) you can paint the same polygon multiple times with different widths and colors. Here is a rough example how this could be implemented:
<Style id="outerLine">
<LineStyle><color>FF0000FF</color><width>6</width></LineStyle>
</Style>
<Style id="innerLine">
<LineStyle><color>FFFFFFFF</color><width>3</width></LineStyle>
</Style>
<Placemark>
<styleUrl>#outerLine</styleUrl>
<LineString><coordinates>6.0,48.0,0 18.0,50.0,0 16.0,41.0,0</coordinates></LineString>
</Placemark>
<Placemark>
<styleUrl>#innerLine</styleUrl>
<LineString><coordinates>6.0,48.0,0 18.0,50.0,0 16.0,41.0,0</coordinates></LineString>
</Placemark>
With this technique the inner line is painted on top of the outer line. Unfortunately this limits the possibilities of making the whole ensemble semi-transparent: If you make the inner line semi-transparent it will not only show the background but also the color of the outer line shining through.