Recent activity
Subscribe to this feed
A comment on the question "Overlay, placement and positioning questions." in Microsoft Live Labs:
it is a div and I set the display to inline just for verbosity (it defaults to inline when you give it an empty string)
I actually changed the behavior to trigger using the animation handler for better effect, rather than the animationFinish handler, and because during animation Seadragon is always adjusting your overlay positions you can't notice it.
Oh and these are non scaling overlays. If you still want to check into it I can post some code tomorrow.
Thanks! – Dustin Moore, on November 25, 2009 01:30
Dustin Moore asked a question in Microsoft Live Labs on November 24, 2009 15:12:
Overlay, placement and positioning questions.Alrighty,
So, thanks to your wonderful help yesterday, I have the overlays I want hiding and showing based on the zoom level of the image, which is great, but I am running into something else, not really a bug, just a result of how Seadragon handles overlay placement.
The challenge is this:
If I use the display: none css style to hide the overlay that I want to hide, the height and width of it essentially get set to Zero, so when I reset the display back to inline and the height and width return, the overlay is in slightly the wrong place until Seadragon animation occurs, then they overlays correct themselves.
So, I have tried using the update functions from the API to reset their position, however they don't seem to have any effect on the Overlays. Am I just missing something?
I have a work around idea, that will work, but if there is an easy way to solve this I thought I would ask the big brains around here.
:D
Dustin Moore marked one of Aseem Kishore's replies in Microsoft Live Labs as useful. Aseem Kishore replied to the question "How Do I Calculate Image Scale?".
A comment on the question "How Do I Calculate Image Scale?" in Microsoft Live Labs:
Thank you Aseem and Daniel, that is exactly what I needed. :)
Just fyi.. in application I have lots of overlays that I don't want shown unless the the "scale" or zoom of the image is at least 50%.
This is exactly the math I needed.
Thanks again! – Dustin Moore, on November 23, 2009 23:04
A comment on the question "How Do I Calculate Image Scale?" in Microsoft Live Labs:
Thanks Daniel! I have been prowling over the API myself. I will play around with the math above and see what it gets me. :D – Dustin Moore, on November 23, 2009 22:27
Dustin Moore asked a question in Microsoft Live Labs on November 23, 2009 22:01:
How Do I Calculate Image Scale?I am trying to write an event that triggers when the image is zoomed in more than %50..
The getZoom method on the Viewport, because it is the ratio of the viewport to the source it changes depending on the screensize, viewport size etc.
Is there a way that I consistently return a number based on the zoom level? Or for that matter a consistent zoom level?
i.e. %50 zoomed %100 zoomed %150 zoomed?
It seems like I would use the TileSource methods for this.. like getPixelRatio(level) or getLevelScale(level), but of course, if the level I am passing these functions is the result of getZoom, it isn't consistent.
Perhaps there is just some additional math involved, any ideas?
Thanks guys!
Dustin
Dustin Moore replied on November 04, 2009 00:54 to the update "Seadragon Ajax updated to 0.8.4!" in Microsoft Live Labs:
Dustin Moore replied on November 04, 2009 00:47 to the update "Seadragon Ajax updated to 0.8.4!" in Microsoft Live Labs:
A comment on the question "Seadragon - iFrame - Fullscreen, Oh My!" in Microsoft Live Labs:
Thanks.. still getting the hang of get satisfaction.. I appreciate your help. – Dustin Moore, on September 13, 2009 18:58
Dustin Moore marked one of Eric Juvet's replies in Microsoft Live Labs as useful. Eric Juvet replied to the question "Seadragon - iFrame - Fullscreen, Oh My!".
Dustin Moore replied on September 08, 2009 17:07 to the question "Seadragon - iFrame - Fullscreen, Oh My!" in Microsoft Live Labs:
Dustin Moore replied on September 08, 2009 14:51 to the question "Seadragon - iFrame - Fullscreen, Oh My!" in Microsoft Live Labs:
Eric,
Thanks for that humbling example. :D (Love the resizable div)
I love what you did with your div. So perhaps I can pick your brain a little.
Essentially what I am doing is using Seadragon to rebuild the flash-based map application located at http://www.discoverymap.com. (pick any market for an example)
So, basically I have a image (a map in this case) and am going to use overlays to notate business locations.
So, there is data that I have to manage here, lots of overlays potentially that will have to pull from a database for the related ad data.
This means that my application will need to communicate with my database through hopefully ajax calls, and my problem currently, is that if other users embed the java in their own site as a widget, current AJAX conventions will limit the type of calls I can make back to my database.
So, unless I can think of another way, I may have to stick to an iframe because of the complexity of my app.
Thanks for your feedback though!
Dustin
Dustmoo replied on August 24, 2009 18:12 to the question "Seadragon - iFrame - Fullscreen, Oh My!" in Microsoft Live Labs:
You know, In thinking about this further, I think it would be much more simple to simply change the control to open a new window with the full screen mode set. That way I can keep it really simple. Though, if any of you have any ideas on how you could create a full-screen type container through an iFrame I would be interested to hear about it.
Dustmoo asked a question in Microsoft Live Labs on August 24, 2009 17:54:
Seadragon - iFrame - Fullscreen, Oh My!A little challenge for the budding Seadragon Community.
I am developing a Seadragon based application that I is going to be used both as a component for my personal website, and as widget for others.
The application is going to be managing large sets of data for use with this component/widget, therefore I am going to be needing to send and receive data from my server on load, and potentially through AJAX calls.
Anyway to the point of the question. It seems to me that the best way for a widget to avoid conflicts of other javascript libraries etc is to load it in an iFrame. Seadragon seems to work fine in an iFrame in it's basic form, but I would like to be able to full-screen the iFrame container from within the iFrame. (I can see you shaking your head already.) :)
So essentially, even though Seadragon would be loaded within an iFrame, do you have any thoughts on if I could modify the parent iFrame and then Seadragon's div container.
Anyway, this is sort of obscure, but if any of you have experience communicating between iFrames, or if there is code within Seadragon to help this along, please give me your thoughts.
If I am simply crazy, let me know too. :D
Sincerely,
Dustin
A comment on the question "How do I move around in the image to pre-determined areas?" in Microsoft Live Labs:
Glad to help too Steve, it helps to solve these problems because who knows when I am going to face the problem in my own app. – Dustmoo, on August 24, 2009 15:04
Dustmoo replied on August 20, 2009 21:19 to the idea "Using the Seadragon.Button for overlays not just controls." in Microsoft Live Labs:
Thanks Aseem, the work around does work fine. I thought I would post it for those who are interested.
This code would create a home button and place it on your art as an overlay:
function addOverlays(viewer){
if (!viewer.isOpen()) {
return;
}
var button = new Seadragon.Button( "Go Home", "img/home_rest.png", "img/home_grouphover.png", "img/home_hover.png", "img/home_pressed.png", null, homeButton, null, null, null );
var point = new Seadragon.Point(0.57105,0.29358); //Overlay point Coordinates
var placement = Seadragon.OverlayPlacement.CENTER;
viewer.drawer.addOverlay(button.elmt, point, placement); //Places Button Overlay
var buttonTrack = new Seadragon.MouseTracker(button.elmt); //Attaches MouseTracker to button
buttonTrack.enterHandler = function(tracker, position, buttonDownElmt, buttonDownAny){
if(!buttonDownAny){
viewer.setMouseNavEnabled(false); //Disables Mouse Nav, only if mouse isn't already pressed.
}
}
buttonTrack.exitHandler = function(tracker, position, buttonDownElmt, buttonDownAny){
viewer.setMouseNavEnabled(true);
}
buttonTrack.setTracking(true);
}
Dustmoo shared an idea in Microsoft Live Labs on August 20, 2009 16:36:
Using the Seadragon.Button for overlays not just controls.Hey there!
I am playing around, and your Seadragon.Button seems well setup to do lots of heavy lifting as far as creating a nice button element with the MouseTracker already included in the element.
I was playing with putting the buttons on the art as an overlay rather than as a control. (I know we are always messing around with things)
It seems that though the button element appears and its roll over up down states all work, the viewfinder is capturing the mouseclick to zoom.
This seems related to
http://getsatisfaction.com/livelabs/t...
So, I will play with the work around from there, (perhaps disable viewfinder mouse nav when the mouse rolls over the button element)
I will post if I find a solution, but thought I would share the thoughts I was having anyway. :)
Thanks!
Dustin
Dustmoo replied on August 20, 2009 16:19 to the question "How do I move around in the image to pre-determined areas?" in Microsoft Live Labs:
Haha, there I go over-complicating it. :) (I think we were replying at the same time) Well Steve, this should give you some good info to go on.
Thanks for the reply Asseem, I am sure I am going to be picking your brain soon. Also, you might want to check the logic in my last reply, it might not be 100% sound. :D
Dustmoo replied on August 20, 2009 16:04 to the question "How do I move around in the image to pre-determined areas?" in Microsoft Live Labs:
I see, your trying to find the correct x, y, for the point that you want to move.
The way the coordinate system works is a bit different from what you are used too. To move the viewfinder you need to feed it point data, and what you have is pixel data.
In pixels, your top-left pixel would be 0,0 and your top-right pixel would be 0,2304.
The points are complicated, (at least from what I can tell) the width of the image is always 1, and the height is based on the aspect ratio of the image, so if your image is half as tall as it is wide, it's height would be 0.5.
So all the points in the image are decimal values in between.
Example:
If my image is 400px x 200px.. The aspect ratio would be 1 to .5.
Therefor, to navigate the viewport to the center point of the image the x would need to be 0.5(half the width) and the y would be 0.25(half the height)
In the case of your image if the width is 2304 and the height is 27147 the ratio would be approximately 1 to 11.78(Your height is 11.78 times your width)
So your center point would be x=0.5(width is always ) and your y would be (approx) 5.89 (Again half of the height ratio)
So, hopefully this explains the math a little bit better, at least the way I understand it from what is explained here:
http://livelabs.com/seadragon-ajax/li...
and some tests of my own.
Now, an easier way to find the exact point you want to navigate too is to use the example on that page to user your mouse to find the exact point you want, then plug that into the above functions.
I used their example to give me the point where the mouse was, and then code that into the system, but the math above should help you calculate it dynamically if you have the pixel data.
There are some pixel to point conversion methods in the viewer, but I haven't tested them to see if they apply to the visible area or the loaded image.
Anyway, I hope this all makes sense, its a lot. :)
Dustin
Dustmoo replied on August 19, 2009 20:20 to the question "Displaying a Deepzoom image with Seadragon" in Microsoft Live Labs:
Hey there Graphics.. you might want to check the case of your path. Depending on where you are hosting the xml, one browser may be more forgiving about the path case than the other browser.
Also, double check your encoding when you upload the .xml file. Sometimes ASCII FTP or Binary transfer can mess up the file you are working with.. but these are just general things to check.
Incidentally, I haven't had any issues with any browsers.
Thanks!
Dustin
| next » « previous |
Loading Profile...
