Wanderland-Sperrungen: request blocked, mixed content

98 views
Skip to first unread message

Jürg Schaufelberger

unread,
Aug 24, 2022, 1:41:40 PM8/24/22
to GeoAdminCh API
When I switch on the Layer "ch.astra.wanderland-sperrungen_umleitungen", a javascript error occurs: 

Mario Keusen

unread,
Aug 25, 2022, 2:43:08 AM8/25/22
to GeoAdminCh API
Thanks for your request. We'll treat this in the technical group and come back to you with an answer soon.
Thanks for your patience and for using *geo.admin.ch
BR Team geo.admin.ch

Brice Schaffner

unread,
Aug 25, 2022, 4:58:13 AM8/25/22
to GeoAdminCh API
Hi Jürg

Could you provide more information on how you do the request ? 

NOTE also that in your example the request use HTTP which will be redirected to HTTPS, it would be better to strictly use HTTPS. Calling your example as is in a web browser works, it just returns an empty result.

Regards Brice

Jürg Schaufelberger

unread,
Aug 25, 2022, 7:18:23 AM8/25/22
to GeoAdminCh API
Hi Brice,

I don't know exactly, but the problem occurs only for about a week or two. I haven't changed anything in the code. My page is https://www.mapit.ch/  and I include
<script src="https://api3.geo.admin.ch/loader.js?version=4.4.2"> 
The url mentioned above (http://api3...)  is not generated by my javascript. I call the function 
my_layers["Sperrungen"] = ga.layer.create("ch.astra.wanderland-sperrungen_umleitungen"); 
I guess, that the Geo Admin API calls the http-url instead of https-url.

As  a workarount, I set the "wanderland-sperrungen" Layer invisible, so the javascript error occurs only if a user enable this layer and only if then an other javascript function is called, e.g. click on a polyline or point which usually calls a Tooltip will then cause a popup with "error occured in tooltip identify..", but the real problem is an javascript error "mixed content" as mentioned above.

Thanks for any hint
Regards Jürg

Brice Schaffner

unread,
Aug 25, 2022, 7:58:51 AM8/25/22
to GeoAdminCh API
Hi Jürg

This is a known issue with the loader.js, we are currently working on fixing it. I'll let you know as soon as the fix is available, might take a few days unfortunately.

Sorry for the inconvenience

Best regards

Brice

Jürgen Hansmann

unread,
Aug 30, 2022, 8:30:08 AM8/30/22
to GeoAdminCh API
Hi Jürg, hi colleagues

There's just a version deployed, that should fix this issue.
Hope everything works for you now.

Best regards
Jürgen

Pascal Probst

unread,
Aug 30, 2022, 12:19:11 PM8/30/22
to GeoAdminCh API
Hy Jürgen 

Our calls to the API do not work anymore. Since 3h.
what was the change?

 ERROR ReferenceError: ga is not defined

Best regards
Pascal 

Brice Schaffner

unread,
Aug 31, 2022, 1:12:31 AM8/31/22
to geoadm...@googlegroups.com
Hi Pascal

The api3.geo.admin.ch APIs recently changed to only allow HTTPS. All HTTP requests will be now redirected to HTTPS with a 301 Moved Permanently. 

Make sure that all your API calls either support redirecting and/or are using HTTPS.

If this doesn't help, we need more information about your issue in order to help (which API call ? How do you use it ? Do you have any logs like browser logs, browser network logs, ...).

Best regards

Brice 


--
You received this message because you are subscribed to a topic in the Google Groups "GeoAdminCh API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geoadmin-api/-xMPg30l1b8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/ed12ad6e-87b8-473e-9542-9985eeaaf5fan%40googlegroups.com.

Pascal Probst

unread,
Aug 31, 2022, 7:50:25 AM8/31/22
to GeoAdminCh API
hi Brice
we only used HTTPS.
I’ve changed public.geo.admin.ch/ domain to api3.geo.admin.ch and it helped

Best regards
Pascal 

Jürg Schaufelberger

unread,
Sep 1, 2022, 4:52:46 PM9/1/22
to GeoAdminCh API
for me, everything works fine now. Thanks!

Jürgen Hansmann

unread,
Sep 2, 2022, 3:33:26 AM9/2/22
to GeoAdminCh API
That's good to hear/read @Jürg and also @Pascal.

Have a nice weekend!
BR
Juergen
Reply all
Reply to author
Forward
0 new messages