Gavin Taylor | 24 Apr 16:26 2014
Picon

WPS on a local machine with no internet server (Apache, etc)

Hi

Can anyone shed some light on how to get WPS requests to work on a local machine with GeoServer installed on that local machine?
 I have read up about proxy scripts etc. But this appears to only work if you have Apache or similar installed. I downloaded the OpenLayers, extracted it to a folder, then open the Examples folder and the wps.html page will not work ("select process" box is not filled as it is on the OpenLayers.org site).

Any help would be appreciated... I am stumped.

Regards
Gavin
_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Frederick Löbig | 21 Apr 20:06 2014
Picon

Touch Navigation and Layer listener (click) - pixelTolerance

Hey,

I have a problem regarding my touch-navigation map having a layerListener listening for clicks on a vector layer. The clicking is very tricky because I think the listener does not register an action as a click, when the finger is not completely still while touching the marker. I've heard of the property 'pixelTolerance' and added it to the listener to pass to the clickHandler, but it does not seem to work. Here is my code:

Map constructor:

map = new OpenLayers.Map('map', {
                layers: [layer, pointLayer, vector],
controls: [
            new OpenLayers.Control.TouchNavigation({
                dragPanOptions: {
                    enableKinetic: true
                },
                clickHandlerOptions: {
                    pixelTolerance: 10 }
            }),
            new OpenLayers.Control.Zoom(),
            new OpenLayers.Control.LayerSwitcher()
        ],
                zoom: 10,
                center: [-1081125, 6212801]
            });


Listener Constructor:

var layerListeners = {
featureclick: function(e) {
//log(e.object.name + " says: " + e.feature.id + " clicked.");
//alert(e.feature.attributes.Name);
ajax_request('mob_detail.php','POST','?t=1&id='+e.feature.attributes.Id,'mob_detailLayer');
return false;
}
};


Layer constructor:

            pointLayer = new OpenLayers.Layer.Vector("Wasserhäuschen", {
            strategies: [new OpenLayers.Strategy.Fixed()],
eventListeners: layerListeners,
            attribution:"© 2014 - <a href=http://www.linie11.org target=_blank>Linie 11 W.l.W. e.V.</a>",
            protocol: new OpenLayers.Protocol.HTTP({
                url: "./geoData/data.xml.gml",
                format: new OpenLayers.Format.GML()
            }),
styleMap: new OpenLayers.StyleMap({'default':defaultStyle,
                                                           'select':selectStyle,
                                                           'temporary':tempStyle
},{
                context: {
                  // ...
                  label: function(feature) {
                    // clustered features count or blank if feature is not a cluster
                    return feature.cluster ? feature.cluster.length : "";  
                  }
                  // ..
                }

})});
registerEvents(pointLayer);


Any ideas?

---
Frederick Löbig
Ingenieur für Geomatik und Geodäsie

Dienst:
Fachreferent bei DB Netz AG
Zentraler Datenmanager und Innovationsverantwortlicher
Infrastrukturdatenmanagement (I.NVT 52)
A: Im Galluspark 23, 60326 Frankfurt am Main
E: Frederick.Loebig-kEbA694X68xy8Y03rUWncA@public.gmane.org

Privat:
Röderichstraße 59
60489 Frankfurt am Main
---
E: Frederick.Loebig-Dz115AEZgoU@public.gmane.org
P: +49 (0) 69 - 78 99 52 41
M: +49 (0) 174 - 70 89 296
S: floebig
_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
adityakumar529 | 21 Apr 09:25 2014
Picon

open layers 3 popup

Hello,
   I am try to integrate 2 examples of Open layers 3.

The first example is the animation example.
http://ol3js.org/en/master/examples/animation.html
The second example is icon example.
http://ol3js.org/en/master/examples/icon.html

On integrating these two examples I am getting the following error.
*
Uncaught TypeError: undefined is not a function *

Error pointing to the line * image: new ol.style.Icon( ({*

Any help how to integrate it will be really helpful.

Thanks
Aditya Kumar

-----
GIS Developer

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/open-layers-3-popup-tp5136178.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
Tobias Kirschke | 20 Apr 15:47 2014
Picon

Load GeoServer WMS secured layers with Openlayers and proxy.jsp

Hello,

I'm trying to load a secured WMS layer from GeoServer in OpenLayers with 
"http://XXXX:XXXX <at> SERVER/geoserver/wms" but it doesn't work. I think the 
problem is the proxy. I use the following proxy.jsp from 
https://github.com/terrestris/JSP-Whitelist-Proxy/blob/master/proxy.jsp

An entry like Username:Password <at> SERVER:8080/geoserver/wms as an allowed 
host does not work.

How can I fix the Problem?

Thank you.

<% <at> page session="false"%>
<% <at> page import="java.net.*,java.io.*" %>
<% <at> page trimDirectiveWhitespaces="true"%>
<%

/**
* ...
*  <at> author terrestris GmbH & Co. KG
*  <at> author Christian Mayer
*  <at> author Marc Jansen
*
*  <at> license BSD see license.txt
*
*/
String[] allowedHosts = {
"www.openlayers.org", "openlayers.org",
"labs.metacarta.com", "world.freemap.in",
"prototype.openmnnd.org", "geo.openplans.org",
"sigma.openplans.org", "demo.opengeo.org",
"www.openstreetmap.org", "sample.azavea.com",
"v-swe.uni-muenster.de:8080",
"vmap0.tiles.osgeo.org"
};
HttpURLConnection con = null;
try {
String reqUrl = request.getQueryString();
String decodedUrl = "";
if (reqUrl != null) {
reqUrl = URLDecoder.decode(reqUrl, "UTF-8");
}
else {
response.setStatus(400);
out.println("ERROR 400: No target specified for proxy.");
}

// extract the host
String host = "";
host = reqUrl.split("\\/")[2];
boolean allowed = false;

// check if host (with port) is in white list
for (String surl : allowedHosts) {
if (host.equalsIgnoreCase(surl)) {
allowed = true;
break;
}
}

// do the proxy action (load requested ressource and transport it to client)
// if host is in white list
if(allowed) {
// replace the white spaces with plus in URL
reqUrl = reqUrl.replaceAll(" ", "+");

// call the requested ressource
URL url = new URL(reqUrl);
con = (HttpURLConnection)url.openConnection();
con.setDoOutput(true);
con.setRequestMethod(request.getMethod());
String reqContenType = request.getContentType();
if(reqContenType != null) {
con.setRequestProperty("Content-Type", reqContenType);
}
else {
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
}

int clength = request.getContentLength();
if(clength > 0) {
con.setDoInput(true);
byte[] idata = new byte[clength];
request.getInputStream().read(idata, 0, clength);
con.getOutputStream().write(idata, 0, clength);
}

// respond to client
response.setContentType(con.getContentType());

BufferedReader rd = new BufferedReader(new 
InputStreamReader(con.getInputStream()));
String line;
int i = 0;
while ((line = rd.readLine()) != null) {
out.println(line);
}
rd.close();
}
else {
// deny access via HTTP status code 502
response.setStatus(502);
out.println("ERROR 502: This proxy does not allow you to access that 
location.");
}

} catch(Exception e) {

// resond an internal server error with the stacktrace
// on exception
response.setStatus(500);
byte[] idata = new byte[5000];

if(con.getErrorStream() != null) {
con.getErrorStream().read(idata, 0, 5000);
}

out.println("ERROR 500: An internal server error occured. " + 
e.getMessage() + " " + new String(idata));
}
%>
ANC | 18 Apr 21:41 2014
Picon

Create and Email GPX file from Vector layer

Hello

I have a mobile app that captures the path a user is following using
geolocation's watch mode. The path points are added to a vector layer. Once
the path capture is finished I want to create a GPX file out of it and email
it to a user selected email address from the mobile device.

The vector layer where the path points are captured is named "path", the map
is in 4326 projection and I am using this code to parse the features as GPX:

var pathfeatures = path.features();

var gpxformat = new OpenLayers.Format.GPX({
            internalProjection: new OpenLayers.Projection("EPSG:4326"),
            externalProjection: new OpenLayers.Projection("EPSG:4326")
        });

var gpxcontents = gpxformat.write(pathfeatures);

My questions are:

1. How do I create the actual GPX file from the "gpxcontents" variable,
something like "path.gpx"?
2. Once the gpx file is created, how can I send it as an email attachment?  

I have searched this forum as well as other resources and have not been able
to find a guideline. I know the second question may not be OpenLayers
related but any help will be appreciated.

Thank you

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Create-and-Email-GPX-file-from-Vector-layer-tp5135947.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
Luca Manganelli | 17 Apr 15:30 2014
Picon

More precise geolocation?

Hi,

is there any way to obtain more precise geolocation?

In my code, the options of Control.geolocation are:

    var geolocate = new OpenLayers.Control.Geolocate({
        id: 'locate-control',
        geolocationOptions: {
            enableHighAccuracy: true,
            maximumAge: 0,
            timeout: 30000
        }
    });

It would be nice to have a precision to some meters, not 50-100 meters away.

Any hints?
_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Frederick Löbig | 14 Apr 15:36 2014
Picon

Pinch-Zoom / Drag while having an active clickControl

Hi all,

I have a small problem which I think can be solved pretty quickly. 

The map I have as multiple different "clickControls", which, depending on which one is activated, lead to several different actions. One of these controls is a simple clickFeature, to show a detail window of the selected vector feature (added via a GML file). I now want to use pinch zoom and simple map dragging without selecting a feature each time I touch the map. So basically, what I want to achieve is, to drag and zoom the map in any case, even if I hold down on a feature. This is my code for the selectFeature control:

clickFeature = new OpenLayers.Control.SelectFeature(
  [pointLayer],
  {
  clickout: true, toggle: false,
  multiple: false, hover: false,
  }
);
map.addControl(clickFeature);
pointLayer.events.on({
  "featureselected": function(e) {
//drag.activate();
                                                //openDetail(e.feature.attributes.Id);
ajax_request('mob_detail.php','POST','?t=1&id='+e.feature.attributes.Id,'mob_detailLayer');
                                                closeToolTip();
//dumpProps(e.feature.attributes);
                                                //document.getElementById("debug").value=e.feature.attributes.Id;
  },
  "featureunselected": function(e) {
closeDetail();
  }
  });
  
clickFeature.activate();





This is the link to the current application: www.linie11.org/mapApp/go_map.php 
Any ideas? Thanks in advance! It's driving me crazy right now...

Cheers,
Freddy
_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Frederick Löbig | 13 Apr 10:22 2014
Picon

Layer . vector problem in Chrome

Hi list,

I have a problem using an gml vector layer in Google Chrome. When I navigate to the following link (www.linie11.org/index.php/karte), all it shows is one marker icon, although all markers are on the map (you can see this via the tooltip info). It works in ff and ie. Is this a known issue? I have not changed anything, happens since the last update of Chrome I guess...

Thanks for your help / info!
Cheers, Freddy
_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users
acousmetre | 11 Apr 11:04 2014
Picon

popup scroll problem on iPad

Hello, I've noticed for some time that scrolling in openlayers popups
doesn't work on iPads (I've tested Safari with iOS7.1 on an iPad2). I've
not found any solutions with Google. Please, does anyone on this list
have any suggestions?

My test page is here: http://audiocena.com.br/cerrado/mapa/index.php

On the iPad, I'm also unable to close the popups - although
popup.destroy() seems to be working, so perhaps I can find a workaround
for this aspect. 

Thanks
acousmetre | 11 Apr 10:44 2014
Picon

popup scroll problem on iPad

Hello, I've noticed for some time that scrolling in openlayers popups
doesn't work on iPads (I've tested Safari with iOS7.1 on an iPad2). I've
not found any solutions with Google. Please, does anyone on this list
have any suggestions?

My test page is here: http://audiocena.com.br/cerrado/mapa/index.php

On the iPad, I'm also unable to close the popups - although
popup.destroy() seems to be working, so perhaps I can find a workaround
for this aspect. 

Thanks
thefairyandthesad | 6 Apr 19:54 2014
Picon

OpenLayers.Control.Measure - change decimal separator

Hello,
 
it seems to be a small problem, but how can I change the decimal separator from point to comma?
 
Setting ...
 
OpenLayers.Number = {
    decimalSeparator: ","
}
 
... in BaseTypes.js doesn´t have any effect.
 
Maybe someone does know the line in the code. Thank you.
 
Chris
_______________________________________________
Users mailing list
Users@...
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Gmane