Skip to content

Commit

Permalink
fixed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmtech committed Apr 28, 2017
1 parent a69d695 commit 3343434
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 45 deletions.
14 changes: 7 additions & 7 deletions demos/hit-surface/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function loadTexture() {
var pointImage = vts.utils.loadImage(
'http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png',
(function(){
pointTexture = renderer.createTexture({ "source": pointImage });
pointTexture = renderer.createTexture({ source: pointImage });
}).bind(this)
);
}
Expand Down Expand Up @@ -81,12 +81,12 @@ function onDrawPoints(renderChannel) {
coords = map.convertCoordsFromNavToCanvas(clickCoords, "fixed");

renderer.drawImage({
'rect' : [coords[0]-12, coords[1]-12, 24, 24],
'texture' : pointTexture,
'color' : [255,0,0,255], //white point is multiplied by red color so resulting point will be red
'depth' : coords[2],
'depth-test' : false,
'blend' : true //point texture has alpha channel so blend is needed
rect : [coords[0]-12, coords[1]-12, 24, 24],
texture : pointTexture,
color : [255,0,0,255], //white point is multiplied by red color so resulting point will be red
depth : coords[2],
depthTest : false,
blend : true //point texture has alpha channel so blend is needed
});
}
};
Expand Down
11 changes: 5 additions & 6 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>VTS Browser Demos</h1>
<h4 class="panel-title">Basic example</h4>
</div>
<div class="panel-body" style="min-height: 150px;">
<p>Basic map browser implementation with pan and zoom controlls.</p>
<p>Basic example which shows how to display the map in the webpage.</p>
<p><a class="btn btn-default" href="./basic/" role="button">View demo &raquo;</a></p>
</div>
</div>
Expand All @@ -53,7 +53,7 @@ <h4 class="panel-title">Basic example</h4>
<h4 class="panel-title">Flights</h4>
</div>
<div class="panel-body" style="min-height: 150px;">
<p>Example showing how to define fly-over location using browser's
<p>Example showing how to fly between locations using browser's
autopilot capabilities.</p>
<p><a class="btn btn-default" href="./flights/"
role="button">View demo &raquo;</a></p>
Expand All @@ -66,7 +66,7 @@ <h4 class="panel-title">Flights</h4>
<h4 class="panel-title">Switching bound layers</h4>
</div>
<div class="panel-body" style="min-height: 150px;">
<p>Layer switcher example, showing other map layers on the
<p>Layer switcher example, showing how to change bound layer on the
surface.</p>
<p><a class="btn btn-default" href="./switching-bound-layers/"
role="button">View demo &raquo;</a></p>
Expand Down Expand Up @@ -116,8 +116,7 @@ <h4 class="panel-title">Lines and images</h4>
<h4 class="panel-title">Hit surface</h4>
</div>
<div class="panel-body" style="min-height: 150px;">
<p>In this example, user can mark point on surface using mouse click.
User can also use panning and zoom controls.</p>
<p>In this example, user can mark point on surface using mouse click.</p>
<p><a class="btn btn-default" href="./hit-surface/" role="button">View demo &raquo;</a></p>
</div>
</div>
Expand All @@ -141,7 +140,7 @@ <h4 class="panel-title">Meshes</h4>
<h4 class="panel-title">Meshes - hit</h4>
</div>
<div class="panel-body" style="min-height: 150px;">
<p>In this demo demonstrates, how to implemnt hit test for
<p>In this demo demonstrates, how to implemnt hit test
for custom polygon meshes. </p>
<p><a class="btn btn-default" href="./meshes-hit-test/"
role="button">View demo &raquo;</a></p>
Expand Down
36 changes: 18 additions & 18 deletions demos/lines-and-images/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function loadTexture() {
var demoImage = vts.utils.loadImage(
'http://maps.google.com/mapfiles/kml/shapes/placemark_circle.png',
(function(){
demoTexture = renderer.createTexture({ 'source': demoImage });
demoTexture = renderer.createTexture({ source: demoImage });
}));
}

Expand Down Expand Up @@ -76,33 +76,33 @@ function onCustomRender() {

//draw line
renderer.drawLineString({
'points' : points,
'size' : 2.0,
'color' : [255,0,255,255],
'depth-test' : false,
'blend' : false
points : points,
size : 2.0,
color : [255,0,255,255],
depthTest : false,
blend : false
});

//draw point image at the first line point
var coords = points[0];
renderer.drawImage({
'rect' : [coords[0]-12, coords[1]-12, 24, 24],
'texture' : demoTexture,
'color' : [255,0,255,255],
'depth' : coords[2],
'depth-test' : false,
'blend' : true
rect : [coords[0]-12, coords[1]-12, 24, 24],
texture : demoTexture,
color : [255,0,255,255],
depth : coords[2],
depthTest : false,
blend : true
});

//draw point image at the last line point
coords = points[points.length-1];
renderer.drawImage({
'rect' : [coords[0]-12, coords[1]-12, 24, 24],
'texture' : demoTexture,
'color' : [255,0,255,255],
'depth' : coords[2],
'depth-test' : false,
'blend' : true
rect : [coords[0]-12, coords[1]-12, 24, 24],
texture : demoTexture,
color : [255,0,255,255],
depth : coords[2],
depthTest : false,
blend : true
});
}
}
12 changes: 6 additions & 6 deletions demos/switching-bound-layers/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ var map = null;
map: 'https://cdn.melown.com/mario/store/melown2015/map-config/melown/VTS-Tutorial-map/mapConfig.json',
position : [ 'obj', 15.096869389048662, 49.38435909591623, 'float', 0.00, 0.00, -90.00, 0.00, 1587848.47, 55.00 ],
view : {
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bmng08-world'
]
},
'freeLayers': {}
freeLayers: {}
}
});

Expand Down Expand Up @@ -56,22 +56,22 @@ function onSwitchView() {
if (button.getElement().checked) { //check switch state
//set map view with bing
browser.map.setView({
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bing-world'
]
},
'freeLayers': {}
freeLayers: {}
});
} else {
//set map view without bing
browser.map.setView({
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bmng08-world'
]
},
'freeLayers': {}
freeLayers: {}
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions demos/switching-geodata/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ function onSwitchView() {
if (button.getElement().checked) { //check switch state
//set map view without geodata
browser.map.setView({
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bing-world',
'bmng08-world'
]
},
'freeLayers': {}
freeLayers: {}
});
} else {
//set map view with geodata
browser.map.setView({
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bing-world',
'bmng08-world'
]
},
'freeLayers': {
freeLayers: {
'mapzen-all-v1': {}
}
});
Expand Down
8 changes: 4 additions & 4 deletions demos/switching-surfaces/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ function onSwitchView() {
if (button.getElement().checked) { //check switch state
//set map view without town
browser.map.setView({
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bing-world',
'bmng08-world'
]
},
'freeLayers': {}
freeLayers: {}
});
} else {
//set map view with town
browser.map.setView({
'surfaces': {
surfaces: {
'melown-viewfinder-world': [
'bing-world',
'bmng08-world'
],
'melown-benatky-nad-jizerou': []
},
'freeLayers': {}
freeLayers: {}
});
}
}
Expand Down

0 comments on commit 3343434

Please sign in to comment.