Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

ISS Location IA #1559

Merged
merged 11 commits into from
Mar 23, 2015
Merged

ISS Location IA #1559

merged 11 commits into from
Mar 23, 2015

Conversation

javathunderman
Copy link
Collaborator

Continuation of #1217. Please refer to the PR template there for more information!

This PR fixes a few things that were not in the old one.

Please let me know if I need to update this comment!

cc @mintsoft @jagtalon @moollaza @MrChrisW @rishiag


IA Page: https://duck.co/ia/view/isslocation

@javathunderman
Copy link
Collaborator Author

@moollaza Is there anything in particular I need to add here?

@jagtalon
Copy link
Member

@javathunderman thanks! We're checking it out!

var issLatitude = (Math.round(api_result.iss_position.latitude * 100) / 100).toFixed(2);
var issLongitude = (Math.round(api_result.iss_position.longitude * 100) / 100).toFixed(2);

DDG.require('maps', function()
Copy link
Member

Choose a reason for hiding this comment

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

Missing opening curly braces.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jagtalon What line?

attribution github => ['https://github.com/rishiag','Rishi Agarwal'],
twitter => ['http://twitter.com/rishiagar','Rishi Agarwal'];

triggers any => "iss location", "iss position";
Copy link
Member

Choose a reason for hiding this comment

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

Other triggers might be "international space station" or maybe "iss tracker / iss tracking" as mentioned in #1217 (comment)

@javathunderman
Copy link
Collaborator Author

@jagtalon Fixed a few issues, but not sure if that's what you meant.

model: 'Place',

view: 'Map',
data: [{
Copy link
Member

Choose a reason for hiding this comment

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

Adding url here should make the link on the map work.

data: [{
    url: "...",
    ...
}]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jagtalon How does that work? Do you mean I should add

url: "(link goes here)",

@jagtalon jagtalon self-assigned this Feb 23, 2015
@javathunderman
Copy link
Collaborator Author

@jagtalon There's an issue that's making the tests fail; I think it's some issue with Travis, not this code, as a lot of old IAs are failing in the error report.

@jagtalon
Copy link
Member

@javathunderman ah I see--don't worry about the tests for now. It's working on my end anyway

@jagtalon
Copy link
Member

@javathunderman looking forward to your changes!

"use strict";
env.ddg_spice_isslocation = function(api_result) {

if(!api_result || api_result !== "success") {
Copy link
Member

Choose a reason for hiding this comment

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

This exits because you're comparing api_result with "success", but you should be comparing api_result.message instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So I replace both instances with "api_result.message"?

Copy link
Member

Choose a reason for hiding this comment

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

Just the latter one. !api_result says, "check if api_result is not null or undefined" and api_result.message !== "success" says that the message property of api_result should equal to "success" to continue.

Looking at http://your-codio-instance:5000/js/spice/isslocation/ should make it clearer. :)

Copy link
Member

Choose a reason for hiding this comment

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

@javathunderman probably best to check

if (!api_result || !api_result.message || api_result.message !== "success"){

If we know the message is always there, you can leave out the check for the existance of api_result.message

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@moollaza Ok, will update tonight.

@jagtalon
Copy link
Member

I think the tab name should be just "Maps" instead of "ISSLocation". What do you think @abeyang @moollaza @MrChrisW @mintsoft?

@mintsoft
Copy link
Collaborator

@jagtalon I agree, ISSLocation looks like it's accidentally not set it or something

@javathunderman
Copy link
Collaborator Author

@jagtalon Maps is OK with me.

@jagtalon
Copy link
Member

jagtalon commented Mar 2, 2015

Alright cool all we need is the asset. Thanks @moollaza

@javathunderman
Copy link
Collaborator Author

@jagtalon Just waiting on an icon from @abeyang and I'll rewrite that CSS.

@mintsoft
Copy link
Collaborator

mintsoft commented Mar 3, 2015

@abeyang no pressure ;)

@jagtalon
Copy link
Member

jagtalon commented Mar 4, 2015

@javathunderman in the mean time, you can apply this change--the JS doesn't work at the moment. #1559 (comment)

@javathunderman
Copy link
Collaborator Author

@jagtalon Sorry for the late response- fixed the JS code.

@abeyang
Copy link
Contributor

abeyang commented Mar 6, 2015

Can we try these on for size? Attaching both 1x and 2x.

gray-dot
gray-dot 2x

Just to know, the exact coordinates should be where the shadow is, not the dot.

@javathunderman
Copy link
Collaborator Author

@jagtalon Doesn't seem like that JS code is working...

@abeyang Implementing this...

@javathunderman
Copy link
Collaborator Author

@moollaza Not seeing that CSS code in any of the files...Where do I replace the pin with that new asset?

@mintsoft
Copy link
Collaborator

mintsoft commented Mar 7, 2015

@javathunderman he's just saying that it should be added to the existing .css file, so that it overrides the styles provided by the inbuilt stylesheets

@mintsoft
Copy link
Collaborator

mintsoft commented Mar 7, 2015

@javathunderman just tried it out with this:

.mapview-marker.mapview-marker-star,
.mapview-marker.mapview-marker-star.has-focus {
    background-image: url("1x.png") !important;
    background-size: 30px 44px !important;

    width: 30px !important;
    height: 44px !important;
    margin-left: -15px !important;
}

@javathunderman
Copy link
Collaborator Author

Ah, thanks. Implementing this…

@javathunderman
Copy link
Collaborator Author

@abeyang Implemented that new icon.

@javathunderman
Copy link
Collaborator Author

@jagtalon Anything else to do here?

@moollaza
Copy link
Member

@javathunderman we'll take a look and get back to you soon

@javathunderman
Copy link
Collaborator Author

@moollaza Small issue- if you move the map so far that you come back to one end of the world, the map pin doesn't show up. Should this be as is?

@moollaza
Copy link
Member

Small issue- if you move the map so far that you come back to one end of the world, the map pin doesn't show up. Should this be as is?

@javathunderman that's a great find -- I think for now we'll consider that tolerated as it seems to be the expected behaviour from Leaflet.js -- Perhaps you should file a bug over there? I'm sure other have noticed this!

@moollaza
Copy link
Member

@javathunderman @mintsoft I made a mistake -- we can't simply drop in the name of the asset to the CSS because the share files require versioned paths.

We'll need to modify the background image using JS and get_asset_path() to generate the path to the image.

@javathunderman
Copy link
Collaborator Author

That CSS worked for sometime until it decided to break…This is probably why. What’s the code I would use? @moollaza @mintsoft

@jagtalon
Copy link
Member

Checking it out!

@jagtalon
Copy link
Member

@javathunderman just add the icon in this PR and everything should be good. Maybe we could just use 2x.png for now. Other than that, https://ddh9.duckduckgo.com/?q=iss+location&ia=map

@jagtalon
Copy link
Member

@javathunderman actually, we got it. Opened a PR here #1675. Thanks for the contribution! :)

jagtalon pushed a commit that referenced this pull request Mar 23, 2015
@jagtalon jagtalon merged commit ccf06b3 into duckduckgo:master Mar 23, 2015
@javathunderman
Copy link
Collaborator Author

@jagtalon no problem. 😄

cc @rishiag Thanks for making the original PR in in #1217!

@moollaza
Copy link
Member

@javathunderman @rishiag congrats! It's live: https://duckduckgo.com/?q=iss+location&ia=map

Sorry for the delay, it's actually been live for about a week.

Thanks again for taking the time to contribute! We really appreciate it. Feel free to stick around and comment/help on other PR's & Issues or even submit more Instant Answers!

@javathunderman
Copy link
Collaborator Author

Yay!

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

Successfully merging this pull request may close these issues.

None yet

5 participants