Coder Social home page Coder Social logo

Comments (6)

itancc avatar itancc commented on June 5, 2024 1

Oh, the parameters may not be suitable. For example, I need to modify the BBox parameters because I will be performing a coordinate transformation, so supporting customtags would be convenient for me to rewrite the bbox

from cesium.

itancc avatar itancc commented on June 5, 2024

I commit a PR for this issue, I really need this change to facilitate my implementation of a feature,Many thanks.

from cesium.

ggetz avatar ggetz commented on June 5, 2024

Hi @itancc! Thanks for the interest!

There is a parameters option which lets you append additional query parameters. Is that sufficient for your use? If not, could you please explain your use case a bit further?

from cesium.

itancc avatar itancc commented on June 5, 2024

Here is some pseudo-code:

const imageryProvider = new WebMapServiceImageryProvider({
  parameters: {
    bbox: "{customBBox}",
  },
  // @ts-ignore
  customTags: {
    customBBox: (
      imageryProvider: ImageryProvider,
      x: number,
      y: number,
      level: number
    ) => {
    const rect = imageryProvider.tilingScheme.tileXYToRectangle(x, y, level);
      // here I can do some custom logic, like transforming the bounding box
      const customRect = transformBboxFunction(rect);
      return `${customRect.west},${customRect.south},${customRect.east},${customRect.north}`
    },
  },
});

from cesium.

ggetz avatar ggetz commented on June 5, 2024

For example, I need to modify the BBox parameters because I will be performing a coordinate transformation,

Thanks @itancc. This may be a bit of an edge case in my opinion. Given that you're re-writing one of the existing parameters, it may be better for you to use UrlTemplateImageryProvider directly.

from cesium.

itancc avatar itancc commented on June 5, 2024

I hope to make the most of some optimizations available in the existing WmsMapServiceImageryProvider, such as cache, which I find excellent! If I switch to using UrlTemplateImageryProvider, I might need to rewrite a whole set of code similar to WmsMapServiceImageryProvider. So, it would be convenient if such an option could be provided. Also, this shouldn't be disruptive, right?

from cesium.

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.