esridc / ember-cli-mapillary

An ember addon for Mapillary JS
https://esridc.github.io/ember-cli-mapillary/
MIT License
1 stars 2 forks source link

Mixed content errors on moveCloseTo() when serving over HTTPS #3

Closed tomwayson closed 8 years ago

tomwayson commented 8 years ago

When serving an app over HTTPS, and calling the viewer's moveCloseTo() method I see these errors in the console:

request.js:139 
Mixed Content: The page at 'https://tomwayson.github.io/ember-cli-mapillary/map-two-way' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://mapillary-vector.mapillary.io/v3/model.json?client_id=cjJ1SUtVOEMtdy…%22package%22%2C%22rect%22%2C%22score%22%2C%22value%22%5D%5D%5D&method=get'. This request has been blocked; the content must be served over HTTPS.

Followed by this awesom rx.js [object Object] error:

screen shot 2016-06-23 at 7 30 50 am

STR:

  1. Navigate to https://tomwayson.github.io/ember-cli-mapillary/
  2. Click on Map (Two Way)
  3. You'll see the above errors

NOTE: those errors do happen when serving the app over HTTP.

Need to figure out a way to force viewer to make requests over same protocol used by the app.

oscarlorentzon commented 8 years ago

@tomwayson It seems like the viewer is initialized without an options struct for the Simple and Map (One Way) examples which works fine. For the Map (Two Way) example the viewer is initialized with and options struct that looks like this: { cover: false, detection: true }. It is actually the Detection component that is activated here that makes the call that causes the error. If you just initialize the viewer without the detection: true setting I would expect it to work.

It is indeed a bug in MapillaryJS that the mixed content error occurs because of the Detection component and I will create an issue for this. For your implementation I am suspecting that the Detection component is not actually needed at this point (it is used to show rectangle overlays on top of the image)?

tomwayson commented 8 years ago

Thank you @oscarlorentzon.

Removing detection: true worked!

https://tomwayson.github.io/ember-cli-mapillary/#/map-two-way

I did not have any particular reason to have included that other than the fact that I was copying code from the Web AppBuilder example. What's interesting is that that app works under HTTPS:

https://mapillary.github.io/Mapillary-WebAppWidget/

oscarlorentzon commented 8 years ago

Glad it worked!

When testing the Web AppBuilder I'm actually receiving the same error message. I will forward the information. Thanks for pointing me in that direction.