Adding map spots using INCLUDE doesn't work for HTML5

  • Hi,

    Strange behaviour: I am trying to add 2500 map spots through <include../> to see if that speeds up the loading. This works for Flash, and if I only have 1 spot it also works for HTML5. But if I have more than 1 (so, even already with 2 spots) it fails with 'parsing error', only for the HTML5. What could be the issue here?

    I have the include statement straight in the vtourskin.xml like so:

    Code
    <layer name="skin_map_container" ... >
    <maptypecontrol ... />
    <radar ... />
    <spotstyle .../>
    <layer name="skin_map_zoom_in"  ... />
    <layer name="skin_map_zoom_out" ... />
          <include url="mapspots.xml" />
    </layer>

    And in the mapspots.xml, standard spots like so:

    Any idea?

  • I still can't get above solution to work, like I said; isn't it strange that it works for Flash, and/but for HTML5 only if there is 1 spot in the INCLUDE?

    I have another solution, but might need some ideas for that:
    similar to above method, I am now including all the scenes with their bare minimum required data in an INCLUDE xml. So only:
    <scene name="scene_name1" title="title1" lat="52.33" lng="4.82" heading="57.65"> </scene>

    The 'skin_addmapspots' will then nicely put all these scenes on the map and indeed much faster than loading all required scenes with their full description. For those wondering, I load every pano through it's own XML after clicking on a mapspot or hotspot, so I only need these scenes to show on the map.
    So far so good, BUT of course, in this large list of included scenes is also the current scene, so it will get overwritten with the bare minimum data, not enough to show the pano. I thought to have tackled that by loading the INCLUDE first and then the current scene, but in that case the first scene in the INCLUDE will be the pano to load, so still no image. I feel I am very close (without having to write new code, which is also possible of course)...

  • Hi,
    Take the include line out of the layer nest.
    Just put it in the first xml with the other includes.
    Also your every scene an xml makes no sense to me.
    Maybe also give the mapspot style a keep="true" (?)

    Hope it helps
    Tuur *thumbsup*

  • Hi Tuur! Thanks for getting back to me.

    Let me first answer your question: my tours consist of 3000+ panos, loading them all at once with 1 XML takes too long to load. Therefore I made 1 XML per pano, and after clicking on a spot it will load the next pano+xml.
    I would still like to show all spots in the map. I have been looking at loading a KML (no go so far) or overlay area image, but then I can't click on every spot separately.

    Loading a bare minimum, just for mapspots, is still not very fast, but good enough for temporary solution.

    I tried including the 'spots-include' with the normal includes, but that doesn't load them, I thought because I needed to load them inside the map layer. Am I wrong? I hope so, because that's a much easier and logically solution. What would be the format then?

    And yes, the keep=true still needs to be added, but first i wanted to have them loaded. Also, i reset every setup on loading the next pano, so still need to carefully exclude the mapspots from resetting (and loading slowly again). That is not so difficult..

  • OK, at least I figured out how to apply the second method (loading include-scenes, instead of include-mapspots), by changing the startup action and naming the scene directly instead of using the standard variable:

    Code
    <action name="startup" autorun="onstart">
    		loadscene(scene_name1, null, MERGE);
    		if(startactions !== null, startactions() );
    	</action>

    works perfectly and reasonably fast.

    Still would like to know how to apply the spots-include, if you get the time to answer me that..

    For now happy.. *smile*

  • And again; thanks!

    The problem is not so much where to put this SPOTS include, but in what format, I think.
    If i put it within the map-layer as indicated, it works for everything but for 2 or more spots in HTML5
    If I put it outside of the maplayer, it doens't seem to be picked up, whichever format, but I reckon that's because I am trying the wrong formats (for the include line or/and for the tags inside the INCLUDE).

    if I reference the INCLUDE inside mentioned layer, the format is just:
    <spot>...</> (inside the INCLUDE.xml)

    Just guessing here, but I tried various things and I can't seem to get it picked up, if I put the include line outside of the mentioned layer and have only spots in the INCLUDE file.

  • Hi Willi,

    Not without the workaround as indicated in this thread no. So, I had it working either with 'include scenes' or putting all the hotspots inside the map layer.
    But it was still not fast enough for 3000+ hotspots, so I am now using a kml layer for overview plus the closest hotspots only.

    Good luck!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!