Opening View



  • Hi All,
    When I open Map Forecast API on my page, the frame is seen with a little bit zoom. I want to show whole world on opening. How could I do this?

    Note: On script file zoom: 1


  • Administrator

    Windy has set minZoom property to value 3. You should be able to change it dynamically: https://stackoverflow.com/questions/27431053/leaflet-set-min-maxzoom-dynamically



  • Hi @marekd,
    Thank you for your interest.I have tried to add codes to my js. file but have failed.

    const options = {
        // Required: API key
        key: 'MY KEY', // REPLACE WITH YOUR KEY !!!
    
        // Put additional console output
        verbose: true,
    
        // Optional: Initial state of the map
        lat: 50.4,
        lon: 14.3,
        zoom: 3,
    };
    
    // Initialize Windy API
    windyInit(options, windyAPI => {
        // windyAPI is ready, and contain 'map', 'store',
        // 'picker' and other usefull stuff
    
        const { map } = windyAPI;
        // .map is instance of Leaflet map
    
      
    });
    
    

    This is my simple code. Where should I add it?



  • @visualanimal

    const { map } = windyAPI;
    map.options.minZoom = 1;    
    

    However, the basemapLayer tiles do not load if minZoom



  • However, the baseLayer tiles do not load if minZoom is less than 3, overlay layer works though.

    (cannot seem to edit my posts, not enough privileges).



  • Hi @rittels ,
    I have tried it but I am not able to see whole map on opening. I am basically try to embed map on projection for my school project. Thus I need to see map like this: https://en.wikipedia.org/wiki/File:Equirectangular_projection_SW.jpg



  • Actually you cannot; Windy maps use the projection EPSG:3857 – Pseudo Mercator, aka. Web Mercator, Google Web Mercator, Spherical Mercator, EPSG:900913 or WGS84 Web Mercator; it is a variant of Mercator projection used as standard in Web mapping.
    Covered area: -180° W, -85°.06 S, 180° E, 85°.06 N

    What you need is EPSG:4326 – WGS84
    The World Geodetic System (aka. WGS) 84 is a standard Coordinate System for Earth, a standard Spheroidal Reference Surface (aka. Datum, Reference Ellipsoid or SRS) and a Gravitational Equipotential Surface (geoid) that defines the nominal sea level. In common language it is assimilated to a cartographic projection and largely used to represent large scale maps. It is used as a standard in GPS, where Geographic Coordinates are not projected: they are provided in longitude and latitude degrees.
    The well-known GCS WGS84 (aka. EPSG:4326) is mainly used to handle (raw) data coordinates (Longitude, Latitude, Altitude) on Earth. As a language abuse, it is also known as a projection.
    Covered area: -180° W, -90° S, 180° E, 90° N

    Reprojecting the original map from EPSG:3857 (the native projection of OSM source) to EPSG:4326 is still possible, you should do it via Leaflet framework...


Log in to reply
 

Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps
Terms and Conditions     Privacy Policy