GithubHelp home page GithubHelp logo

Comments (7)

emergingdzns avatar emergingdzns commented on September 16, 2024

The png file I was trying to load is very large (dimensionally and file size) so just as a test, I created a new image in illustrator that just has a single solid color in it and exported to jpg. The dimensions are still 13997px by 10413px but the file size is only 1.6 MB. But I am still getting the error. I really like mapstraction's implementation, but I need to be able to overlay the image.

from mxn.

brunob avatar brunob commented on September 16, 2024

Hi, this problem seem to come from a limitation in openlayers API (the bug don't seem to be due to mapstraction). I've found a post where someone have a similar problem with openlayers API :

http://lists.osgeo.org/pipermail/openlayers-users/2010-February/015982.html

Can you try to load your image only using openlayers API (without mapstration) ? If it don't load, the bug is certainly in OL API, and you can close this issue.

++

from mxn.

emergingdzns avatar emergingdzns commented on September 16, 2024

I was able to load the image in native openlayers. Sadly I wasn't able to use mxn, but I'd very much like to in future versions. Here is the code snippet I used in native OL to load the large image:

            if (type == "lon") {
                var newll = ll \* 20037508.34 / 180;
            } else {
                var newll = Math.log(Math.tan((90 + ll) \* Math.PI / 360)) / (Math.PI / 180);
                newll = newll \* 20037508.34 / 180;
            }
            return newll;  
        }

imgbounds = new OpenLayers.Bounds(ll2ol(-105.424392,'lon'),ll2ol(43.975458,'lat'),ll2ol(-105.317911,'lon'),ll2ol(44.087556,'lat'));
    var overlay = new OpenLayers.Layer.Image(
    "Aerial View", 
    "/media/mapassets/CORDEROAPR11.jpg", // TO DO: make the url to the image dynamic from db
    imgbounds,
    new OpenLayers.Size(27994, 20832),
    {'isBaseLayer': false, 'alwaysInRange': true}
);
layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Open Street Maps",{transparent: true},{buffer:3, tileLoadingDelay: 0,isBaseLayer: true});
map.addLayers([overlay,layerMapnik]);```

Hope that helps solve the problem.

from mxn.

brunob avatar brunob commented on September 16, 2024

Could you provide us a link to this big image in order to debug your problem ?

from mxn.

brunob avatar brunob commented on September 16, 2024

Hi, are you still having this issue ?

If yes, could you provide us a link to your image ? If no, you can close this issue.

++

from mxn.

brunob avatar brunob commented on September 16, 2024

Since there is no update for this issue for a long time, i think we should close it. Any objection ?

from mxn.

gilesc50 avatar gilesc50 commented on September 16, 2024

Likewise

from mxn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.