Posts by gius

    Hi all,
    I am not an expert in programming at all. Some time ago I found a way to use osm maps on krpano by myself. Now I see it is possible to do that using krpano as maps viewer inside krpano. I had a look at this example

    https://krpano.com/viewsource.htm…s/maps/maps.xml

    on krpano site.

    I am wondering how to add a radar plugin on the active hotspots on a project like the above example.

    Thank you for any help and advice.

    Best regards,
    Giuseppe

    Solved by trying.
    The heading attribute in <scene> is set by GPSImgDirection in EXIF data: it works when settting GPSImgDirection in degree with decimal.

    But the view.hlookat is also set as the heading which I do not want.

    I would like to have view.hlookat at 0.0, i.e. where the stirched pano is centered. Then I will use heading (from gps device when taking the picture) to set the radar and the compass.
    I set
    prealignheading=false in config file but that does not seem to work.

    Can someone suggest a way to avoid the view.hlookat to be set as the heading from Exif data?

    Thank you in advance.

    Giuseppe

    Sorry,
    I did not have images with GPS data and I did not realised that Krpano stores lat and lng on <scene> where I can access for custom actions which is what I need.
    I put GPS data on images via Exiftool. I can not find a tag for HEADING. I tried GPSImgDirection and GPSDestBearing but the heading attribute on <scene> in the tour.xml remains unchanged.

    Is the heading attribute in <scene> set from any EXIF data? which?

    Thank you.

    Giuseppe

    Hi,
    I would like to add lat, lng and heading attributes to each scenes of a tour consisting of many panos.
    I can have this data either:
    1) on metadata of each jpeg pano
    2) or on a separate file or on <data> in tour.xml

    I would like to do that not by manually adding the attributes.
    I suppose I have 1) to change something in config file (preferred) and/or 2) coding some action on tour.xml but I do not know how.

    Any ideas, hints, suggestions on how to proceed?

    Thank you very much for any help.
    Best regards,
    Giuseppe

    hello,
    I have a plugin map container with osm map:

    The activespot changes x, y when dragging/moving the map according to a function of lat/lng of the point on the map. But when x, y are outside the plugin width and height the activespot is still visible, despite maskchildren="true" attribute on map plugin.
    On my_map_plugin.js I set:

    plugin.sprite.style = "align-items:center";

    If that line is omitted the activespot is masked out as expected per maskchildren="true" attribute.
    But in this case the map is shown in the topleft of the map container (the rest of the map container is void).

    Any idea about this behaviour?
    Thank you for any suggestions and help.

    Giuseppe

    HI,

    I have a compass copied from krpano example with minor mods:



    The compass pointer does not rotate on viewchange.

    Am I missing something?

    Thank you for any help.

    Giuseppe

    Klaus,
    thank you very much: I will try to implement.
    Previously I tried:

    krpano.events.onnewscene = function(){ ..

    here map.latLngToContainerPoint() a function from Leaflet which converts geographical coods to x.y coords
    and code to set x, y coords for an activespot/layer in in the xml
    .... }

    The above is in the plugin.js file and It works, but perhaps it is not a clean code, so I will change according to your coding.
    I would prefer to do the following in xml code :

    <scene name="my_ scene" onstart="update_spot_onthemap();">

    <action name="update_spot_onthemap">

    .............//here I would put in some way map.latLngToContainerPoint() which gives x,y coords of a point on the map

    set(layer[activespot].x, 'coord.x');
    set(layer[activespot].y, 'coord.y');

    </action>

    In general (for other use): after plugin.my_function = function(){ } in the plugin.js I can call/use my_function in the xml. Is that correct?


    Thank you and best regards,

    Giuseppe

    Thank you very much for explanation!
    Not sure to understand correctly:
    <action name="newsceneaction">jsget(returnedValue, 'someFunction()');trace('value: ', get(returnedValue));</action>

    In my case someFunction() would be a function from the js plugin, i.e. the function map.latLngToContainerPoint() from leaflet.js: it converts latlng geographical coords to x,y coords in the map container.
    Just to explain, I have a testing tour with 3 images .

    In the xml file I have a plugin/layer linked with a file.js where I built the osm map; a layer for an active spot with an icon and a layer for the radar plugin.
    When I change scene (onnewscene) I would like to place the active spot and radar layers on the map layer according to the x,y coords given by the map.latLngToContainerPoint().
    I would like to do that with an action on the xml file.
    So I need "to pass" the returned value of map.latLngToContainerPoint() (which is a function on the js plugin) to an action on the xml file which is called 'onnewscene'.

    Hi,
    I am asking the same question on reverse:
    how to call a js function on a js plugin from a Krpano event (e.g. onnewscene)?
    I did this on the plugin.js:

    krpano.events[onnewscene] = function() {myFunction()};

    function myFunction() {
    //js code, i.e. a function from Leaflet
    krpano.set(//setting an attribute on a krpano layer according to a value from the previous function ...)
    }

    but it does not work.

    Alternatively I would like to do on krpano (xml file):

    <scene name=myscene" onstart="my_Function()">

    <action name="my_Function">

    <!-- a js function: a leaflet function from the plugin.js -->
    set('layer[mylayer].attribute, <!-- a value from the previous js function --> )

    </action>

    but I do not know how to proceed.

    Any suggestions?

    Thank you very much for help.

    Giuseppe

    Hi,
    I have a custom map plugin and I would like to access/call a js function, actually a function from Leaflet.js library, in the plugin. I would like to call this function from the xml file, i.e. from a krpano action called by an event, "onstart" a new scene.
    Can anyone tell me how to do that?

    Many thanks for help,
    Giuseppe

    Hi,
    I am reading documentation but I cannot find how to do the following.

    I have in the xml file:

    <plugin name="myplugin" devices="html5" type="container" ........ url="myplugin.js" >

    <layer name="mylayer" .................. />
    </plugin>

    Would it be possible to add attributes and set value to "mylayer" from "myplugin.js"?
    How?

    Thank you.

    Regards,

    Giuseppe

    Thank you very much.
    In the meanwhile any suggestions from anyone about what is wrong in my code would be very helpful.
    I would like to use OSM and, in any case, I would like to know the way it works for further customisation and/or to use other free map resources.

    Hi,
    I am trying to build an OSM plugin: no experience in jS, xml etc....
    Here what I achieved copying and pasting here and there..:
    http://www.lingua.it/giropano/index.html
    Two (main) problems:
    1) the map is not centered as expected and does not zoom properly: when zooming it seems the center is moving....
    2) the text in popup does not desplay, thouth when downloading leaflet,js and leaflet.css directly on the folder it works. Actually I am not interested in popups but...just to understand why....

    Here is from pano.xml:

    ..................
    <!-- maps plugin - use Google for HTML5 and Bing for Flash -->
    <plugin name="map" devices="html5"
    keep="true"
    url="osmkrplugin.js"
    align="lefttop" x="10" y="10" width="270" height="370"
    >


    </plugin>

    And here is osmkrplugin.js:


    Thank you for any suggestions and hints.

    Regards,

    Giuseppe

    Thank you for explaination.
    I was just trying to insert a floorplan in a pano.
    I can do that using an image layer (url="myfloorplan.jpg").

    I tried also to use a plugin (url="myplugin.js"). I used the plugin example at https://krpano.com/docu/plugininterface/#top
    trying to modify: dropping the action and other stuff not related, I presume, with the insertion of the image.
    I used: document.createElement("img") and document.innerHTML.........
    but nothing happens.
    Maybe the above is a nonsense ...
    Thank you for any hints.

    Hi,
    I am trying to learn with the trial version.
    I see you can "insert" an image in a pano by way of a layer (url="image").
    I am wondering if it is possible to do that by a file.js, like the one shown in the plugin interface example (i.e. url="file.js" in the xml layer).

    Thank you for any help.

    Regards,

    Giuseppe

    Hi,
    I would like to use OSM maps in VT.
    The discontinued (krpano based) Panotour Giga by Kolor had this possibility.
    Anyone could give any hints on how to build such a plugin or any programmers in the forum could write the code to sell?

    Thank you very much for suggestions and help.

    kind regards,

    Giuseppe

    Hi,
    I am new to the forum and a beginner in Krpano.

    I would like to to do some Vt like "streetview".
    For example: I have 100 geolocated panos (pano1, ........, pano100) to link in a VT.


    Here is my question hoping someone can help and give suggestions.
    Is it possible to build the VT with an "automathic" process ( i.e. by "putting" all the panos together in krpano ) this way:

    each pano has two hotspots (one for the next pano and one for the previous pano);
    each pano has a map with the hotspots of all the geolocated panos;
    the hotspot in the map which refers to the actual pano is highlighted and has a radar



    Here is something similar to what I would like to do:
    https://www.applied-streetview.com/automotive/

    Of course I am not asking for a tutorial (if any) but some hints in order for me to have an idea of the possible procedure.


    Thank you in advance.

    Best regards,

    Giuseppe