You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Alexey Tkachenko

Professional

  • "Alexey Tkachenko" started this thread

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

1

Wednesday, September 3rd 2014, 11:04am

Bing Map strange "zoom in" at start

Hi everyone!

We're trying now to fit Bing Map into our custom VT skin and faced a problem. I spent whole day yesterday trying to understand where's the bug in my code or mistake, but to no success. So I stripped all and left only map layer and copied bits of code from standard "vtourskin.xml" bing map, but anyway this strange behaviour happens.

the case is this:

1) open the link

http://tours.viewit360.se/develop/bug_reports/bing/

2) the map shows and loads
3) click on "zoom in" or "zoom out" button and map zooms too much in into some area in Atlantic ocean.
4) After that it works fine.

However, if I touch the map itself at the start, and then click "zoom in" or "zoom out" button, map works fine and no "crazy" zoom in occurs.

Here's the code of bing Map layers: http://tours.viewit360.se/develop/bug_re…g/skin/skin.xml

One more strange thing is that I don't see such behaviour if map is used inside the default "vtourskin.xml". So I wonder what the heck I'm doing wrong here or maybe there's some tricky hidden bug?

Thanks for any help! *smile*
Regards,

Alexey

2

Wednesday, September 3rd 2014, 12:08pm

Hi,

there seems to be no spots on the map - try removing the zoomToSpotsExtent() call and/or try to set the initial lat/lng/zoom that you want.

Best regards,
Klaus

Alexey Tkachenko

Professional

  • "Alexey Tkachenko" started this thread

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

3

Wednesday, September 3rd 2014, 12:17pm

Sorry, Klaus, my mistake for no spot - tried using Bing coordinates (with commas) instead of google coordinates. But it didn't help. I have just fell back to the original code as it was in my post. Returned back to google coordinates.

Updated link http://tours.viewit360.se/develop/bug_reports/bing/


Stil the same "crazy" zoom in... Hmm... What am I doing wrong....? *cry*
Regards,

Alexey

Tuur

Sage

Posts: 3,325

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

4

Wednesday, September 3rd 2014, 1:45pm

Are you sure you took out the zoomToSpotsExtent call?

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Alexey Tkachenko

Professional

  • "Alexey Tkachenko" started this thread

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

5

Wednesday, September 3rd 2014, 2:30pm

Hi, Tuur!

zoomToSpotsExtent(); is used in standard "skin_addmapspots();" action, so I thought it's not the reason, however will now delete zoomToSpotsExtent(); and see if it makes any difference...


... aha... removed zoomToSpotsExtent();
and now map starts right in the middle of the Atlantic... hmm... So, there seems to be some clash of "layer[skin_map].zoomin();/layer[skin_map].zoomout(); and zoomToSpotsExtent();
action .. hmmm.... but why doesn't this occur in standard skin? *confused*

Another try - I used pantospot(); in the end of 'skin_addmapspots();" action and again this "crazy" zoom occured....

Seems there's some connection between pantospot/zoomToSpotExtent and layer[skin_map].zoomin();/layer[skin_map].zoomout(); action... But why does the code work inside standard skin and gives this "crazy" zoom here? *blink* this is what really puzzles me...

I left pantospot(); in the end of "skin_addmapspots" to see what happens... The link is the same:

http://tours.viewit360.se/develop/bug_reports/bing/
Regards,

Alexey

Tuur

Sage

Posts: 3,325

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

6

Wednesday, September 3rd 2014, 3:37pm

Hi Alexey,

When i look at your previous posted xml link i miss in the bingmaps layer this information:

numbers could be of ;-)

Source code

1
lat="52.702666" lng="5.298932"


in my xml it looks like:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
		<layer name="map" keep="true" enabled="true"
				   url="../plugins/googlemaps.swf" alturl="../plugins/googlemaps.js"
				   align="center" x="0" y="20" width="320" height="320"
				   key="ilovekrpano"
				   maptype="hybrid"
				   lat="52.702666" lng="5.298932" zoom="19"
				   zorder="20"
					onmapready="zoomToSpotsExtent();"
				   >
	 <positioncontrol visible="false" />
  <zoomcontrol     visible="false"  />
  <maptypecontrol  visible="false" />
				<spotstyle name="DEFAULT" url="../skin/vtourskin_mapspot.png" activeurl="../skin/vtourskin_mapspotactive.png"  edge="bottom" x="-5" y="-8" scale="0.3" zorder="100"/>	


etc etc


hope it helps!

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Alexey Tkachenko

Professional

  • "Alexey Tkachenko" started this thread

Posts: 760

Location: Sevastopol, Crimea, Russian Federation

Occupation: Interpreting, Building virtual tours

  • Send private message

7

Wednesday, September 3rd 2014, 4:06pm

Thanks!

I added the lat and lng into "skin_map" and it now works fine. Seems that it needs these values anyway inside the map layer... that means I went the wrong way when copied the code from "vtourskin.xml", because there the "skin_map" has

Source code

1
lat="0" lng="0" 
and works fine (and I don't see any action which sets these values dynamically).

Thanks again, Tuur, for looking into it *tongue*
Regards,

Alexey

Tuur

Sage

Posts: 3,325

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

8

Wednesday, September 3rd 2014, 4:21pm

Good it works!
Offcourse the plugin needs to know where to look in the first place .. haha..

Glad i could help.

Cheers!
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Similar threads