Align the center of the OPEN Street Map?

  • In the maps2.xml, there is a view section:

    Code
    	<!-- set the startup view -->
    	<view lat="41" lng="16" zoom="3" />

    Set the lat / lng / zoom to the values you like, for example

    Code
    	<view lat="34" lng="135" zoom="5" />


    You can also use the "panto()" function to go to a specific lat/long:

    Code
    panto(34,135,5,1,easeinquart)


    Edit: Just realised that this does not "center" the map, but just moves the view, hope it helps you anyaway.


    gr,

    Kristof

  • Hi,

    your question reminded me on a already long planed feature - the possibility to let flat panos horizontally wrap around.

    It would be possible to scale up hfov and imagewidth by a certain factor (e.g. 3,5,7,...) and then wrap around the tile coordinates in the customParseTilePath function. And when panning around and exceeding the original hfov edges, adjusting the view.hlookat position automatically to be always inside the original hfov range. This would give the impression of endless horizontal scrolling/panning.

    It would be already possible to implement that manually in krpano, but for the next release I have added now a new mode that does this all fully automatic and also a few things more like automatically also adjusting the hotspots.

    That means - with the next krpano release there will be a new 'wraparound' setting for the <image> element - and when enabled flat panos will automatically able to wrap horizontally around. Then any position on such map can be the center.

    Best regards,
    Klaus

  • Wow!!!

    Thank you klaus.krpano -san.
    Thank you for your reply.

    Google Maps is not bad, but I would love to get right into production!
    Many people view Google Maps as the same as an application or web driven....

    Sadly, I am not familiar with programs or code.
    I want to open a tour about a point in a spot placed on the map.
    Is it possible for you to teach me the code?

  • As written it depends on your example...

    ...so lets assume you use the maps2 example:

    krpano.com - Examples

    Then look in the maps2.xml for these lines:

    Code
    <!-- set the startup view -->
    <view lat="41" lng="16" zoom="3" />

    and replace them with something like this:

    Code
    <!-- set the startup view -->
    <view lat="35" lng="136" zoom="6" />
  • klaus.krpano -san.

    Is there a way to specify a minimum zoom value?
    For example, I would like to be able to minzoom 4.6.

    In other words, make it appear larger in the center of Japan,
    I was wondering if there is a way to make people aware of neither the right nor the left edge.

    <view lat="35" lng="136" zoom="6" />

    Something like this ...
    <view lat="35" lng="136" minzoom ="4.6" />

    My apologies if my English does not come across well.
    I came up with a spec that the zoom is Japan centered and cannot zoom out.

    Thank you.

    • Official Post

    Again - lets assume you use the maps2 example:

    krpano.com - Examples

    Look for this line:

    Code
    <scene name="openstreetmaps" autoload="true" onstart="set(view.fovmax,1);">

    and change it to:

    Code
    <scene name="openstreetmaps" autoload="true" onstart="view.fovmax = zoom_to_hfov(4.6);">

    That the zoom level will be limited to 4.6 and it will be not possible to zoom out more than that.


    Sorry, I don't understand that:

    Quote

    I was wondering if there is a way to make people aware of neither the right nor the left edge.


    Best regards,
    Klaus

  • klaus.krpano -san.

    Thank's.
    Sorry for the late reply.

    Thank you very much.
    It is now closer to the ideal display.

    *It is difficult for an amateur to specify a draggable range of up, down, left, and right.

    1.20.11:NG
    1.21..2:OK

    Rebuild with new version.*g*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!