-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi All,
We have been working on an OpenLayers ZK widget component and we have nearly got it to work.
But our client has complained about the mixed content with https and http, due to our site is https and we are accessing the map tiles from a http. I have found this solution:
http://gunnicom.wordpress.com/2010/10/14/redirect-from-https-to-http-works-for-tiles-from-openlayers/
Which I am trying to convert to jsp:
<% String x = request.getParameter("x"); String y = request.getParameter("y"); String z = request.getParameter("z"); String[] server = new String[3]; String url = ""; server[0] = "a.tile.openstreetmap.org"; server[1] = "b.tile.openstreetmap.org"; server[2] = "c.tile.openstreetmap.org"; url = "http://"+server[0]; url += "/" + z + "/" + x + "/" + y + ".png"; response.setStatus(response.SC_MOVED_PERMANENTLY); response.setHeader("Location", url); %>
But I need to run this jsp from within the ZK widget:
var redirectURI = zk.ajaxURI("web/js/openstreetmap/tileRedirect.jsp?z=${z}&x=${x}&y=${y}", { au : true }); var osmLayer = new OpenLayers.Layer.OSM("Mapnik", redirectURI);
I have to use zk.ajaxURI and the client finds tileRedirect.jsp but it doesnt execute, when I go directly to the jsp (http://127.0.0.1:8080/openstreetmap/zkau/web/js/openstreetmap/tileRedirect.jsp?z=4&x=0&y=10) it out puts the jsp code instead of running the jsp!!!
Any ideas on how to fix this?
Thanks!
I don't completely understand your implementation but looking at ajaxURI API I think since it is a jsp then it should go through servlet lifecycle rather than zk update engine so instead of { au : true } I would use { au : false }. Did you try that?
Asked: 2012-10-05 02:39:37 +0800
Seen: 89 times
Last updated: Oct 08 '12