OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2009-02-20 13:06:31

jclb
Member
Registered: 2009-02-20
Posts: 3

OpenLayers 2.7 - KML with Region and NetworkLink

Hi all,

I've done KMLs with <Region> and <NetworkLink>
All is ok when I use them on Google Earth.
But with OpenLayers 2.7, nothing is displayed, where is the problem ?
Other KML without <Region> works very well on the application.

in the JS

       // creation de la couche SYNOP
    var synop = new OpenLayers.Layer.GML(
        "SYNOP",
        "../kml/synop.kml" ,
        {projection: new OpenLayers.Projection("EPSG:4326"), formatOptions: {extractAttributes: true, extractStyles: true},
        format: OpenLayers.Format.KML, maxDepth: 2}
    )

part of the main KML

                        <NetworkLink>
                <Region>   
                    <LatLonAltBox>
                        <north>-20</north>
                        <south>-30</south>
                        <east>-160</east>
                        <west>-180</west>
                    </LatLonAltBox>
                </Region>
                <Link>
                    <href>synopGA.kml</href>
                    <viewRefreshMode>onRegion</viewRefreshMode>
                </Link>
            </NetworkLink>

part of Link KML

<Region>   
                        <LatLonAltBox>
                            <north>40</north>
                            <south>30</south>
                            <east>60</east>
                            <west>40</west>
                        </LatLonAltBox>
                    </Region>
       
                <Placemark>
                    <name>oups</name>
                    <styleUrl>#point-3</styleUrl>
                    <description>
                    hello
                    </description>
                    <Point>
                        <coordinates>41.1667,39.95</coordinates>
                    </Point>
                </Placemark>


Thank's for yours ideas !

Offline

#2 2009-02-20 15:09:43

jclb
Member
Registered: 2009-02-20
Posts: 3

Re: OpenLayers 2.7 - KML with Region and NetworkLink

I've found one of the problems

js code was :

// creation de la couche SYNOP
    var synop = new OpenLayers.Layer.GML(
        "SYNOP",
        "../kml/synop.kml" ,
        {projection: new OpenLayers.Projection("EPSG:4326"), formatOptions: {extractAttributes: true, extractStyles: true, maxDepth: 2},
        format: OpenLayers.Format.KML}
    )

and not this :

// creation de la couche SYNOP
    var synop = new OpenLayers.Layer.GML(
        "SYNOP",
        "../kml/synop.kml" ,
        {projection: new OpenLayers.Projection("EPSG:4326"), formatOptions: {extractAttributes: true, extractStyles: true},
        format: OpenLayers.Format.KML, maxDepth: 2}
    )

now I 've this HTML error :

Erreur : erreur de syntaxe
Fichier Source : http://mankell.smirne.meteo.fr/TestDev/ … rteObs.php
Ligne : 1, Colonne : 50
Code Source :
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

something with KML path...

Offline

#3 2009-02-20 15:40:55

jclb
Member
Registered: 2009-02-20
Posts: 3

Re: OpenLayers 2.7 - KML with Region and NetworkLink

Solved...

In the KML file, the path for the <href> must be ../kml/synopGA.kml  and not synopGA.kml
I've tried web path, and strict path /kml/ without succes...

Now It works, excepts the styles...

Today is a good day !

Offline

Board footer

Powered by FluxBB