thientung / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

Change style of placemark #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Fraser,

First of all thank for all your great work with this library!

What should this feature enhancement do?
Is there a way to to add 'styles' to a placemark created with your library as 
i'm used to working with the GEPlugin like the following:

KmlStyleCoClass style = m_ge.createStyle("");

//do style stuff....label color, icon, iconscale etc  -> set the style to pm:
placemark.setStyleSelector(style);

BR,
TKM

Original issue reported on code.google.com by tho...@gmail.com on 25 May 2011 at 7:59

GoogleCodeExporter commented 9 years ago
please disregards this post as I've found out it can be done in native js as 
you say in your examples on this page.
I'll wait a bit longer before posting again! :d

/TKM

Original comment by tho...@gmail.com on 25 May 2011 at 9:46

GoogleCodeExporter commented 9 years ago
Hi again... 
In terms of adding styles to placemarks and or linestrings the 
createlinestring() in gehelpers could be changed to do that - I anyway found 
that helpfull.

//Added this to createlinestring()

            int width = 1,
            string color = "ffffffff")

                if (placemark.getStyleSelector() == null)
                {
                    placemark.setStyleSelector(ge.createStyle(""));
                }

                dynamic lineStyle = placemark.getStyleSelector().getLineStyle();
                lineStyle.setWidth(width);
                lineStyle.getColor().set(color);

Original comment by tho...@gmail.com on 27 May 2011 at 8:20

GoogleCodeExporter commented 9 years ago
Hey,

Thanks, that looks like it could be useful - I was going to make a
'createStyle' method in the next release so I think we had the same idea!

Anyhow, thanks for the feedback.

Fraser.

e: http://www.msa.mmu.ac.uk/~fraser/

Original comment by fraser.c...@gmail.com on 27 May 2011 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by fraser.c...@gmail.com on 26 Aug 2011 at 8:57

GoogleCodeExporter commented 9 years ago

Original comment by fraser.c...@gmail.com on 10 Feb 2012 at 8:56

GoogleCodeExporter commented 9 years ago
Just tested it and it works greate. 
Thanks Fraser.

Original comment by tho...@gmail.com on 11 Feb 2012 at 10:43

GoogleCodeExporter commented 9 years ago
Hey thom ( sorry dont knw ur full name, may be thomas)

Can you please provide me a code snippet as how you have tested the createStyle 
method of this library. I was trying out to use it but i think may be my 
approach is wrong or the way i have understand its usage have some issue.

I have to create my own icon, so i have written the following code:

var mystyle = KmlHelpers.CreateStyle(ge, "mypin");

var icon = ge.createIcon("");
        icon.setHref("http://maps.google.com/mapfiles/kml/paddle/red-circle.png");
        var style = ge.createStyle("mypin");
        style.getIconStyle().setIcon(icon);
        style.getIconStyle().setScale(5.0);

But now, I am not getting how do i associate it with the Placemark i want to 
create.

Can you help me out in using this kind of functions on this library?

Original comment by nitinkum...@gmail.com on 29 Jun 2012 at 1:25