From 334343414e44441c213df4812bee87839a938494 Mon Sep 17 00:00:00 2001 From: David Levinsky Date: Fri, 28 Apr 2017 16:45:36 +0200 Subject: [PATCH] fixed examples --- demos/hit-surface/demo.js | 14 +++++------ demos/index.html | 11 ++++----- demos/lines-and-images/demo.js | 36 ++++++++++++++-------------- demos/switching-bound-layers/demo.js | 12 +++++----- demos/switching-geodata/demo.js | 8 +++---- demos/switching-surfaces/demo.js | 8 +++---- 6 files changed, 44 insertions(+), 45 deletions(-) diff --git a/demos/hit-surface/demo.js b/demos/hit-surface/demo.js index 9fde8e17..f4834c0b 100755 --- a/demos/hit-surface/demo.js +++ b/demos/hit-surface/demo.js @@ -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) ); } @@ -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 }); } }; diff --git a/demos/index.html b/demos/index.html index 31eb552f..e4f2fbba 100755 --- a/demos/index.html +++ b/demos/index.html @@ -42,7 +42,7 @@

VTS Browser Demos

Basic example

-

Basic map browser implementation with pan and zoom controlls.

+

Basic example which shows how to display the map in the webpage.

View demo »

@@ -53,7 +53,7 @@

Basic example

Flights

-

Example showing how to define fly-over location using browser's +

Example showing how to fly between locations using browser's autopilot capabilities.

View demo »

@@ -66,7 +66,7 @@

Flights

Switching bound layers

-

Layer switcher example, showing other map layers on the +

Layer switcher example, showing how to change bound layer on the surface.

View demo »

@@ -116,8 +116,7 @@

Lines and images

Hit surface

-

In this example, user can mark point on surface using mouse click. - User can also use panning and zoom controls.

+

In this example, user can mark point on surface using mouse click.

View demo »

@@ -141,7 +140,7 @@

Meshes

Meshes - hit

-

In this demo demonstrates, how to implemnt hit test for +

In this demo demonstrates, how to implemnt hit test for custom polygon meshes.

View demo »

diff --git a/demos/lines-and-images/demo.js b/demos/lines-and-images/demo.js index 2e6f2d08..53c2a83d 100755 --- a/demos/lines-and-images/demo.js +++ b/demos/lines-and-images/demo.js @@ -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 }); })); } @@ -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 }); } } diff --git a/demos/switching-bound-layers/demo.js b/demos/switching-bound-layers/demo.js index 8f46dc4e..703d7fb5 100755 --- a/demos/switching-bound-layers/demo.js +++ b/demos/switching-bound-layers/demo.js @@ -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: {} } }); @@ -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: {} }); } } diff --git a/demos/switching-geodata/demo.js b/demos/switching-geodata/demo.js index 427328da..866fb3ea 100755 --- a/demos/switching-geodata/demo.js +++ b/demos/switching-geodata/demo.js @@ -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': {} } }); diff --git a/demos/switching-surfaces/demo.js b/demos/switching-surfaces/demo.js index 91045a81..d82b8f0d 100755 --- a/demos/switching-surfaces/demo.js +++ b/demos/switching-surfaces/demo.js @@ -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: {} }); } }