Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
688ed2c7
Commit
688ed2c7
authored
May 16, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stop using global variables everwhere to display the map
parent
d824780b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
24 deletions
+29
-24
poc/safeimage/js/form.js
poc/safeimage/js/form.js
+5
-4
poc/safeimage/js/safeimage.js
poc/safeimage/js/safeimage.js
+24
-20
No files found.
poc/safeimage/js/form.js
View file @
688ed2c7
...
@@ -33,9 +33,7 @@
...
@@ -33,9 +33,7 @@
},
},
displayData
:
function
(
id
){
displayData
:
function
(
id
){
if
(
map
!==
undefined
){
var
zoomify_url
,
zoomify_width
,
zoomify_height
;
map
.
destroy
();
}
zoomify_url
=
"
image/
"
+
id
+
"
/
"
;
zoomify_url
=
"
image/
"
+
id
+
"
/
"
;
//XXX look at the xml definition inside image folder
//XXX look at the xml definition inside image folder
if
(
id
==
'
openphotonet_imgp0034-1
'
)
{
if
(
id
==
'
openphotonet_imgp0034-1
'
)
{
...
@@ -46,7 +44,10 @@
...
@@ -46,7 +44,10 @@
zoomify_height
=
1944
;
zoomify_height
=
1944
;
}
}
$
(
this
).
form
(
'
render
'
,
'
image
'
,
{
'
image_id
'
:
id
});
$
(
this
).
form
(
'
render
'
,
'
image
'
,
{
'
image_id
'
:
id
});
$
(
loadOpenLayerZoomedImage
);
$
(
function
()
{
SafeImage
.
loadOpenLayerZoomedImage
(
zoomify_width
,
zoomify_height
,
zoomify_url
);
})
},
},
render
:
function
(
template
,
data
){
render
:
function
(
template
,
data
){
...
...
poc/safeimage/js/safeimage.js
View file @
688ed2c7
var
zoomify_width
=
29566
;
var
SafeImage
=
(
function
()
{
var
zoomify_height
=
14321
;
var
zoomify_url
=
"
image/hs-2007-16-a-full_jpg/
"
;
var
map
,
zoomify
;
var
that
=
{}
;
function
loadOpenLayerZoomedImage
(){
that
.
loadOpenLayerZoomedImage
=
function
(
zoomify_width
,
/* First we initialize the zoomify pyramid (to get number of tiers) */
zoomify_height
,
zoomify_url
){
var
zoomify
=
new
OpenLayers
.
Layer
.
Zoomify
(
"
Zoomify
"
,
zoomify_url
,
if
(
that
.
map
!==
undefined
){
new
OpenLayers
.
Size
(
zoomify_width
,
zoomify_height
)
);
that
.
map
.
destroy
();
}
/* First we initialize the zoomify pyramid (to get number of tiers) */
that
.
zoomify
=
new
OpenLayers
.
Layer
.
Zoomify
(
"
Zoomify
"
,
zoomify_url
,
new
OpenLayers
.
Size
(
zoomify_width
,
zoomify_height
)
);
/* Map with raster coordinates (pixels) from Zoomify image */
/* Map with raster coordinates (pixels) from Zoomify image */
var
options
=
{
var
options
=
{
maxExtent
:
new
OpenLayers
.
Bounds
(
0
,
0
,
zoomify_width
,
zoomify_height
),
maxExtent
:
new
OpenLayers
.
Bounds
(
0
,
0
,
zoomify_width
,
zoomify_height
),
maxResolution
:
Math
.
pow
(
2
,
zoomify
.
numberOfTiers
-
1
),
maxResolution
:
Math
.
pow
(
2
,
that
.
zoomify
.
numberOfTiers
-
1
),
numZoomLevels
:
zoomify
.
numberOfTiers
,
numZoomLevels
:
that
.
zoomify
.
numberOfTiers
,
units
:
'
pixels
'
units
:
'
pixels
'
};
};
map
=
new
OpenLayers
.
Map
(
"
map
"
,
options
);
that
.
map
=
new
OpenLayers
.
Map
(
"
map
"
,
options
);
map
.
addLayer
(
zoomify
);
that
.
map
.
addLayer
(
that
.
zoomify
);
map
.
setBaseLayer
(
zoomify
);
that
.
map
.
setBaseLayer
(
that
.
zoomify
);
map
.
zoomToMaxExtent
();
that
.
map
.
zoomToMaxExtent
();
};
};
\ No newline at end of file
return
that
}());
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment