Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide format:tiles source and proj param #991

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

dbauszus-glx
Copy link
Member

This works with:

"autonavi": {
  "format": "tiles",
  "URI": "http://webrd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
  "source": "XYZ"
},

However the tiles are shifted.

@dbauszus-glx dbauszus-glx added Bug A genuine bug. There must be some form of error exception to work with. Feature New feature requests or changes to the behaviour or look of existing application features. labels Nov 1, 2023
@dbauszus-glx dbauszus-glx linked an issue Nov 1, 2023 that may be closed by this pull request
@dbauszus-glx dbauszus-glx marked this pull request as draft November 1, 2023 12:24
@dbauszus-glx dbauszus-glx changed the title Provide format:tiles source param Provide format:tiles source and proj param Nov 1, 2023
Copy link

sonarqubecloud bot commented Nov 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@dbauszus-glx
Copy link
Member Author

layer.source and layer.projection can now be defined as layer param.

I created a plugin for the gcj02 mercator projection which is basically web-mercator with the gcj02 obfuscation datum.

import { GCJ02 } from "https://esm.sh/ol-proj-ch";

export default (function () {

    const gcj02Mercator = new ol.proj.Projection({
        code: "gcj02",
        extent: ol.proj.get("EPSG:3857").getExtent(),
        units: "m"
    });

    const ll2merc = ol.proj.getTransform("EPSG:4326", "EPSG:3857");
    const merc2ll = ol.proj.getTransform("EPSG:3857", "EPSG:4326");

    ol.proj.addProjection(gcj02Mercator);

    ol.proj.addCoordinateTransforms(
        "EPSG:4326",
        gcj02Mercator,
        (x) => ll2merc(GCJ02.fromEPSG4326(x)),
        (x) => GCJ02.toEPSG4326(merc2ll(x))
    );

    ol.proj.addCoordinateTransforms(
        "EPSG:3857",
        gcj02Mercator,
        (x) => ll2merc(GCJ02.fromEPSG3857(x)),
        (x) => GCJ02.toEPSG3857(merc2ll(x))
    );

})()

@dbauszus-glx dbauszus-glx marked this pull request as ready for review November 2, 2023 11:42
@RobAndrewHurst RobAndrewHurst merged commit fe2908a into GEOLYTIX:main Nov 6, 2023
6 checks passed
@dbauszus-glx dbauszus-glx deleted the xyz-tiles branch January 29, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with. Feature New feature requests or changes to the behaviour or look of existing application features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide format:tiles source and proj param
2 participants