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

I have some problem,when i want to get layerGroups data by your api #1

Closed
0x2d3c opened this issue Nov 16, 2018 · 3 comments
Closed
Labels
in-progress We Are working on this New Feature New Feature

Comments

@0x2d3c
Copy link

0x2d3c commented Nov 16, 2018

i can't find get layerGroup's method, in your code. but i have fix it now by learning your code, thank you very much

`

    type Group struct {
        Type string `json:"@type,omitempty" xml:"type"`
        Name string `json:"name,omitempty" xml:"name"`
        Href string `json:"href,omitempty" xml:"href"`
    }
    type LayerGroup struct {
        Name      string `json:"name" xml:"name"`
        Mode      string `json:"mode" xml:"mode"`
        Title     string `json:"title" xml:"title"`
        Workspace struct {
	        Name string `json:"name" xml:"name"`
        } `json:"workspace" xml:"workspace"`
        Publishables struct {
	        Published []*Group `json:"published" xml:"published"`
        } `json:"publishables" xml:"publishables"`
        Styles struct {
	        Style []*Group `json:"style" xml:"style"`
        } `json:"styles" xml:"styles"`
        Bounds struct {
	        MinX float64 `json:"minx" xml:"minx"`
	        MinY float64 `json:"miny" xml:"miny"`
	        MaxX float64 `json:"maxx" xml:"maxx"`
	        MaxY float64 `json:"maxy" xml:"maxy"`
	        Crs  string  `json:"crs" xml:"crs"`
        } `json:"bounds" xml:"bounds"`
    }

    type LayerGroups struct {
        LayerGroup LayerGroup `json:"layerGroup" xml:"layerGroup"`
    }
    target := utils.Catalog.ParseURL("rest", "workspaces", workspace.Name, "layergroups", "xxxx")
request := geoserver.HTTPRequest{
	Method: "GET",
	Accept: "application/json",
	URL:    target,
	Query:  nil,
}
response, code := utils.Catalog.DoRequest(request)
if code != http.StatusOK {
	utils.Logger.Error("get layer groups error", zap.Int("error code", code))
	c.JSON(http.StatusInternalServerError, utils.BaseResponse(http.StatusInternalServerError, "internal server error", c.Request.RequestURI, nil))
	return
}
var groups defs.LayerGroups
utils.Catalog.DeSerializeJSON(response, &groups)
server := &defs.Server{
	BaseServiceUrl: utils.Catalog.ParseURL(workspace.Name, "wms?"),
	Layers:         fmt.Sprintf("%s:%s", groups.LayerGroup.Workspace.Name, groups.LayerGroup.Name),
	TilematrixSet:  groups.LayerGroup.Bounds.Crs,
}

`

@hishamkaram hishamkaram added New Feature New Feature question Further information is requested labels Nov 16, 2018
@hishamkaram
Copy link
Owner

Thank for reporting such issue, you can see the progress on layer groups from here

@hishamkaram
Copy link
Owner

@BranchOfFate feel free to report issues, request new features and contribute to this repository

@hishamkaram hishamkaram added in-progress We Are working on this and removed question Further information is requested labels Nov 16, 2018
@hishamkaram
Copy link
Owner

fixed

hishamkaram pushed a commit that referenced this issue Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress We Are working on this New Feature New Feature
Projects
None yet
Development

No branches or pull requests

2 participants