Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

add the ability to set layer thumbnail #173

Merged
merged 5 commits into from
Jul 1, 2017

Conversation

hishamkaram
Copy link
Contributor

setThumbnail Function for geonode-client instead of geoexplorer one

Whart does this PR do?

add setThumbnail Function for geonode-client instead of geoexplorer one.
now in geonode we need to call the new function something like this:

<script type="text/javascript">
        $('#set_thumbnail').click(function () {
            window.setThumbnail(5);
            $('#edit-layer').modal('toggle');
        });
    </script>

Screenshot

screenshot_2017-05-29_16-59-21
screenshot_2017-05-29_16-58-16

Related Issue

#88

@bartvde
Copy link
Collaborator

bartvde commented May 29, 2017

Not sure if you saw the existing work on this: #144

@bartvde
Copy link
Collaborator

bartvde commented May 29, 2017

did you also write a new endpoint (thumbnail/react) or how does this work?

@hishamkaram
Copy link
Contributor Author

the new end point will handle this post request and create resource thumbnail

@hishamkaram
Copy link
Contributor Author

@bartvde I will Create pull request to geonode now to add the new endpoint

@hishamkaram hishamkaram reopened this May 29, 2017
@bartvde
Copy link
Collaborator

bartvde commented May 29, 2017

@hishamkaram any chance you can refactor your js code so that the core code is in src/services/geonode.js instead like in #144 ?

@hishamkaram
Copy link
Contributor Author

ok no problem I am going to do that

@hishamkaram
Copy link
Contributor Author

@bartvde could I create pull request to geonode to add the new endpoint?!

@hishamkaram
Copy link
Contributor Author

We can use the same old point for react and geoexplorer by sending post paramter to determine the type of layer preview

@bartvde
Copy link
Collaborator

bartvde commented May 30, 2017

let's discuss with @jj0hns0n and @milafrerichs about the geonode endpoint, guys, any input?

@hishamkaram
Copy link
Contributor Author

@bartvde ok , also now I use the same ENDPOINT

@hishamkaram
Copy link
Contributor Author

satellite baseLayer Added and layer-switcher postion fixed
screenshot_2017-05-30_10-51-31
screenshot_2017-05-30_10-51-04

endpoint: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
standard: 'XYZ',
attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
thumbnail: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/0/0/0'
Copy link
Collaborator

@bartvde bartvde May 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do it this way, this is normally managed on the Django side in geonode for the base maps. Imagine people in a disconnected environment.

@@ -158,6 +167,7 @@ class GeoNodeViewer extends React.Component {
mapUrl = (<MapUrlLink/>);
}
}
console.log(this.state);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log statement

@bartvde
Copy link
Collaborator

bartvde commented May 30, 2017

@hishamkaram let's keep this PR for the thumbnail, and not add other stuff in here, this will make it easier to review and merge. TIA

@hishamkaram
Copy link
Contributor Author

@bartvde last commit was reverted

@milafrerichs
Copy link
Collaborator

can you refresh my memory and explain why we need a new endpoint?

Copy link
Collaborator

@milafrerichs milafrerichs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With all the line changes it's hard to determine what is added and what is just a style change.
Can you explain why you changed the style of certain lines?

@bartvde
Copy link
Collaborator

bartvde commented May 30, 2017 via email

@hishamkaram
Copy link
Contributor Author

No need for the new endpoint . I added a condition to skip generating image in server side if react is the sender because the Image blob would be in the request body. Please review this pull request in geonode here @milafrerichs @bartvde

@hishamkaram
Copy link
Contributor Author

I.e I use the old ENDPOINT and check if react (geonode client ) is the sender in this point

@kalxas
Copy link
Member

kalxas commented Jun 27, 2017

@milafrerichs @bartvde is this ok to merge or does it need more changes?

@bartvde
Copy link
Collaborator

bartvde commented Jun 27, 2017

@hishamkaram can you rebase this on master to see if it fixes the tests? TIA

@hishamkaram
Copy link
Contributor Author

ok no Problem @bartvde

hisham waleed karam added 3 commits July 1, 2017 04:29
setThumbnail Function for geonode-client instead of geoexplorer one
base code now reside in src/service/geonode.js
@hishamkaram
Copy link
Contributor Author

@bartvde Done

@hishamkaram
Copy link
Contributor Author

you can find details about changes in geonode here
@bartvde @kalxas @milafrerichs

@bartvde bartvde merged commit 46ac8b1 into GeoNode:master Jul 1, 2017
@bartvde
Copy link
Collaborator

bartvde commented Jul 1, 2017

thank you @hishamkaram

@kalxas
Copy link
Member

kalxas commented Jul 2, 2017

thanks @hishamkaram

@hishamkaram
Copy link
Contributor Author

@bartvde @kalxas you are welcome!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants