Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

ciul

Schüler

  • »ciul« ist der Autor dieses Themas

Beiträge: 149

Wohnort: Colombia

Beruf: Creative developer guy

  • Nachricht senden

1

Dienstag, 10. April 2012, 01:10

Krpano Interface Call function undefined

Hi Krpano pals,

Krpano has a javascript interface with 3 functions: set, get and call.

But I'm getting undefined for the call function, while set and get are retrieving correctly.

Odd behavior or I don't know.

I'd appreciate any help on this.

In attachments the print screen of my javascript console.

Regards,
Ciul
»ciul« hat folgendes Bild angehängt:
  • krpano call undefined.jpg

Beiträge: 1 836

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

2

Dienstag, 10. April 2012, 05:36

Call doesn't return. It's always given undefined for me.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

ciul

Schüler

  • »ciul« ist der Autor dieses Themas

Beiträge: 149

Wohnort: Colombia

Beruf: Creative developer guy

  • Nachricht senden

3

Dienstag, 10. April 2012, 19:36

Solved although still strange

Hi Krpano pals,

finally solved it.

The issue was that my client krpano swf files were old although xml files were new versions.
I just changed the file to one of mines which is latest krpano versions and that's it, not odd behavior anymore.

Although, older versions should have the javascript interface functions too since these are flash external interface native functions, but who knows.

Thank you.

Regards,
Ciul

Zephyr

Profi

Beiträge: 991

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

4

Freitag, 13. April 2012, 16:49

It's weird that it works for you, since $('krpano').set would call the set function on the jquery object. To get the DOM Element you need to do $('krpano')[0] or just document.getElementByID('krpano')
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

ciul

Schüler

  • »ciul« ist der Autor dieses Themas

Beiträge: 149

Wohnort: Colombia

Beruf: Creative developer guy

  • Nachricht senden

5

Freitag, 13. April 2012, 17:05

It's weird that it works for you, since $('krpano').set would call the set function on the jquery object. To get the DOM Element you need to do $('krpano')[0] or just document.getElementByID('krpano')
I use MooTools which is non as intrusive as jQuery, and after updated the krpano.swf file from my client for one of mines which are updated, it worked flawlessly :)

Thanks for sharing your experience Zephyr *thumbup*

Regards,
Ciul

Zephyr

Profi

Beiträge: 991

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

6

Freitag, 13. April 2012, 20:42

I like jQuery together with underscore.js and Backbone.js. I made Facebook app with custom tagging plugin
with that :)

Mootoo;s has some nice class like methods, that jquery lacks. But other then that they're both the same, so I never bothered picking up mootools :)
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

ciul

Schüler

  • »ciul« ist der Autor dieses Themas

Beiträge: 149

Wohnort: Colombia

Beruf: Creative developer guy

  • Nachricht senden

7

Freitag, 13. April 2012, 20:46

Hi Zephyr,

Yeah, I haven't said jQuery can't be capable of doing nice things, just that I use MooTools due to it being a little more advanced when non-DOM stuff is required (that's my personal opinion), otherwise, jQuery is nicer for manipulating DOM and fancy effects. My point of view if biased since I prefer MooTools anyway.

Yeah, I saw your tagging app, I did one myself too on MooTools, it's nice to bind Krpano with other API's out there *smile*

I'm lately working on a new version of something I called MooKrpano, basically is a bunch of scripts which allow me to develop krpano js plugins very quicly. I use it depending my clients needs; lately had shown it's capabilities to krpano pals via skype and they agree is just nice.
Recoding it trying to make it reachable from simple krpano xml syntax, hope I achieve it, wish me luck.

Regards,
Ciul

Zephyr

Profi

Beiträge: 991

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

8

Donnerstag, 19. April 2012, 23:39

Good Luck ;)

Lately I'm experimenting with Backbone.js together with a REST API and krpano. Backbone has models, views, collections and routes

for instance I can say:

Quellcode

1
2
var hotspot = new HotspotView({model: new Hotspot()});
hotspot.render()


or even simpeler:
var hotspot = new Hotspot({ath: 10, atv: 10});

Quellcode

1
2
3
hotspots.add(hotspot); //add it to collection which has hooks to auto render a hotspot in krpano
hotspots.save() //save all hotspots through a REST API directly in the database.
//or just save 1 hotspots, hotspot.save()


And it autogenerates a hotspot within krpano, with a random name and default values and styles.

I dont want a hotspot? Easy

Quellcode

1
2
hotspot.remove() //removes it from collection
hotspot.destroy() //remove from collection and database


this ofcourse alsoo works with View, Display (which has checks to updateobject()) and Plugins.

Since it's all javascript, binding a jquery ui slider to for instance the x/y or ath/atv values of a hotspot is a piece of cake. I bind the slider change event to update the Hotspot model. The hotspot model listens to changes, and updates krpano automagicly.

Quellcode

1
hotspot.set({url: 'test.png', ath: 0, atv: 100, customproperty: 'cake', customobject: {yup: 'even nested object'}}


Next to that. Collections allows me to filter real quick. Just show hotspots within a certain ath range? Or all hotspots that open a panorama, or just all hotspots with visible false. Just a few lines

Quellcode

1
2
3
var visible_hotspots = hotspots.filter(function(hotspot) {
  return hotspot.get("visible") === true;
});


This allows me to work MVC and OOP with krpano. I can create tiny plugins or define hotspots that open popups, locations, videos, galleries etc and create a whole reusuable library.

It's the basis of my CMS now.

Real fun stuff :) I get exited just talking about it *love*
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

ciul

Schüler

  • »ciul« ist der Autor dieses Themas

Beiträge: 149

Wohnort: Colombia

Beruf: Creative developer guy

  • Nachricht senden

9

Donnerstag, 19. April 2012, 23:49

Good Luck ;)

Lately I'm experimenting with Backbone.js together with a REST API and krpano. Backbone has models, views, collections and routes
[...]
Hi Zephyr,

surely sounds exciting, it excited me too, amazing job u have done *thumbup*

CakePHP, Joomla and MooTools are my allies.
I wrote (and currently re-factoring a new version) MooKrpano, which basically is a MooTools Plugin that allows to do what you do with jQuery.

Like:
pano = new Pano(etc etc) it is a wrapper of native createPanoViewer
pano.createHotspot('name', url, {ath: 0, atv: 20}) and so on with plugins, sound, videos and else.

It might be similar just than in a MooTools flavor.

I get excited about this too :)

Regards,
Ciul

Zephyr

Profi

Beiträge: 991

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

10

Freitag, 20. April 2012, 00:06

Yeah I know mootools have Classes too. But what I discovered with Backbone is the power of events. With the correct binding, I can say hotspot.set({ath: 0}); The hotspot model fires a change event. I can make my view listen to this change event, and let it for instance re-render the hotspot in krpano. Or update some form. So if you bind for instance a jquery slider to a model, and say while sliding do hotspot.set(ath: ui.value) you suddenly see your hotspot live reacting to this sliding. then just do hotspot.save() which is an internal function of backbone (I dont have to write code for that) and it auto posts to the url you provide. I was amazed how easy it all was.

You can alsoo extend stuff. So if you for instance have a good hotspot base. But instead of opening panoramas, make it open a Popup. You just create a new type. var PopupHotspot = Hotspot.extend({});

The only thing I miss in krpano, is dynamicly adding preview and image attributes. Then I wouldnt need xml at all :D
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

ciul

Schüler

  • »ciul« ist der Autor dieses Themas

Beiträge: 149

Wohnort: Colombia

Beruf: Creative developer guy

  • Nachricht senden

11

Freitag, 20. April 2012, 00:14

Yeah I know mootools have Classes too. But what I discovered with Backbone is the power of events. [...]
Hy Zephyr,

I'm glad you discovered that *thumbsup*

Uhh, I am not going deep in MooKrpano but yes, it allows all that too as simple javascript events.

pano = new Pano(...);
var hotspot1 = pano.createHotspot('name', 'url', {options here as any krpano hotspot property});

and to add Events while creating it, just pass the options prefixed with "on".
example:
var hotspot1 = pano.createHotspot('name', 'url', {
onOver: function() {
// do something
},
onUp: function() {
// do something
}
});


or these can be bound after created too with addEvent, just like normal MooTools code.
It is a javascript plugin that abstracts Krpano, just that.

Regards,
Ciul

Ähnliche Themen