Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create NetworkLinkControl Object #390

Closed
apurvabanka opened this issue Nov 19, 2024 · 7 comments · Fixed by #392
Closed

Create NetworkLinkControl Object #390

apurvabanka opened this issue Nov 19, 2024 · 7 comments · Fixed by #392
Assignees
Milestone

Comments

@apurvabanka
Copy link
Contributor

Create the NerworkLinkControl. Example structure.

<NetworkLinkControl>
      <minRefreshPeriod>43200</minRefreshPeriod>
      <maxSessionLength>-1</maxSessionLength>
      <linkSnippet>
      <![CDATA[
      <p xmlns="http://www.w3.org/1999/xhtml">A snippet of <a href="http://www.w3.org/TR/xhtml-basic/">XHTML</a></p>
      ]]>
      </linkSnippet>
      <expires>2008-05-30</expires>
      <Update>
        <targetHref>http://barcelona.galdos.local/svn1/sqa/ets-kml/main/test/data/ogc-kml/files/ge_.kmz</targetHref>
        <Delete>
          <PhotoOverlay targetId="id_550e8400-e29b-41d4-a716-446655440000" />
        </Delete>
        <Create>
          <Folder targetId="Folder-001">
			<name>Mauris vulputate pulvinar.</name>
          </Folder>
        </Create>
        <Change>
          <TimeSpan targetId="id_f272fc30-185d-11dd-bd0b-0800200c9a66">
            <begin>2008-03-15T00:00:00Z</begin>
            <end>2008-03-29T00:00:00Z</end>
          </TimeSpan>
        </Change>
      </Update>
    </NetworkLinkControl>
@cleder
Copy link
Owner

cleder commented Nov 19, 2024

Have a look at the schema fastkml/schema/ogckml22.xsd or https://developers.google.com/kml/documentation/kmlreference#networklinkcontrol

<element name="NetworkLinkControl" type="kml:NetworkLinkControlType"/>
  <complexType name="NetworkLinkControlType" final="#all">
    <sequence>
      <element ref="kml:minRefreshPeriod" minOccurs="0"/>
      <element ref="kml:maxSessionLength" minOccurs="0"/>
      <element ref="kml:cookie" minOccurs="0"/>
      <element ref="kml:message" minOccurs="0"/>
      <element ref="kml:linkName" minOccurs="0"/>
      <element ref="kml:linkDescription" minOccurs="0"/>
      <element ref="kml:linkSnippet" minOccurs="0"/>
      <element ref="kml:expires" minOccurs="0"/>
      <element ref="kml:Update" minOccurs="0"/>
      <element ref="kml:AbstractViewGroup" minOccurs="0"/>
      <element ref="kml:NetworkLinkControlSimpleExtensionGroup" minOccurs="0"
        maxOccurs="unbounded"/>
      <element ref="kml:NetworkLinkControlObjectExtensionGroup" minOccurs="0"
        maxOccurs="unbounded"/>
    </sequence>
  </complexType>

@apurvabanka
Copy link
Contributor Author

@cleder Created a Draft PR for this issue #392

Can you suggest how to handle the <Update> tag under NetworkLinkControl? The Update tag can take in any element. How to handle a dynamic element under Update tag?

@cleder
Copy link
Owner

cleder commented Nov 23, 2024

<NetworkLinkControl>
  <minRefreshPeriod>0</minRefreshPeriod>           <!-- float -->
  <maxSessionLength>-1</maxSessionLength>          <!-- float --> 
  <cookie>...</cookie>                             <!-- string -->
  <message>...</message>                           <!-- string -->
  <linkName>...</linkName>                         <!-- string -->
  <linkDescription>...</linkDescription>           <!-- string -->
  <linkSnippet maxLines="2">...</linkSnippet>      <!-- string -->
  <expires>...</expires>                           <!-- kml:dateTime -->
  <Update>...</Update>                             <!-- Change,Create,Delete -->
  <AbstractView>...</AbstractView>                 <!-- LookAt or Camera -->
</NetworkLinkControl>

@cleder
Copy link
Owner

cleder commented Nov 23, 2024

Syntax

<Update>
  <targetHref>...</targetHref>    <!-- URL -->
  <Change>...</Change>
  <Create>...</Create>
  <Delete>...</Delete>
</Update>

Description
Specifies an addition, change, or deletion to KML data that has already been loaded using the specified URL. The specifies the .kml or .kmz file whose data (within Google Earth) is to be modified. <Update> is always contained in a NetworkLinkControl. Furthermore, the file containing the NetworkLinkControl must have been loaded by a NetworkLink. See the "Topics in KML" page on Updates for a detailed example of how Update works.

Elements Specific to Update
Can contain any number of , , and elements, which will be processed in order.

https://developers.google.com/kml/documentation/kmlreference#example-of-change

<Update>
  <targetHref>...</targetHref>    <!-- URL -->
  <Change>...</Change>
  <Create>...</Create>
  <Delete>...</Delete>
</Update>

https://developers.google.com/kml/documentation/kmlreference#example-of-create
https://developers.google.com/kml/documentation/kmlreference#example-of-delete

@cleder cleder linked a pull request Nov 23, 2024 that will close this issue
@cleder cleder added this to FastKML Nov 25, 2024
@cleder
Copy link
Owner

cleder commented Nov 25, 2024

I think the first step is to implement the <Delete> object.

@cleder cleder moved this to In Progress in FastKML Nov 27, 2024
@cleder cleder added this to the Version 1.1 milestone Nov 27, 2024
@cleder
Copy link
Owner

cleder commented Nov 29, 2024

Hmm, on second thought, I think it would be better to implement the NWC, without the <update> object for now, just with the LookAt/Camera and

    min_refresh_period: Optional[float]
    max_session_length: Optional[float]
    cookie: Optional[str]
    message: Optional[str]
    link_name: Optional[str]
    link_description: Optional[str]
    link_snippet: Optional[str]
    expires: Optional[KmlDateTime]
    view: Union[Camera, LookAt, None]

like they are already in your PR.
Then create another issue to implement the Update Object to be tackled independently.

@apurvabanka
Copy link
Contributor Author

@cleder Marked the PR as ready. You can proceed with the review.

@cleder cleder closed this as completed Dec 2, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in FastKML Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants