Tag Info

New answers tagged

0

You can try using OpenLayers click, and not jquery click. Here are examples: OpenLayers-2.13.1/examples/click.html, getting-the-coordinates-of-a-click-in-openlayers-map/ I created an example and uploaded to my website, it is available here: http://xerocode.com/gis/Openlayers.html Fragments from my html file. Pay attention to the START/END blocks. ...


0

I did this just a couple of days ago. The error that you are getting doesn't have anything to do specifically with OL3. The error that you are facing, has to do with setup tools not being installed. I have found that the easiest way to get this done, is to download ez_setup.py and install it from there. To recap, you need to do this: Download the ...


0

There's nothing Linux specific in these installation instructions as far as I can see. They should work the same in a windows command shell. Only make sure, that you've installed all the dependencies. After you've installed all dependencies you should be able to use build.cmd on your windows system. What exactly is not working on your system?


0

For remote ajax requests, you need proxy living on the server, to pass your server requests to the server in differenet domain. The proxy.cgi script is part of OpenLayers distribution, you can find (and configure!) it in examples directory. Just copy it out into your's server cgi-bin directory. I do not know much about the WPSClient implementation you ...


0

Don't force the projection at the layer level as that will confuse GeoServer - it implies your data source has lied about it's projection and you are overriding it. Everything will work fine the way you have it set up, but for maximum speed you should reproject your base datasets to 900913 (or 3857 in more modern language) as otherwise each time a tile is ...


0

I've got a similarly interrogation, have you tried the tag ChannelSelection ? http://docs.geoserver.org/stable/en/user/styling/sld-reference/rastersymbolizer.html#ChannelSelection If you find a other solution to this problem, could you give us the issue ?


0

For example : You can use an ORM Postgresql .net


1

It's a bit out of date, but this workshop shows the basic concept (using JSTL, not ASP though). http://workshops.boundlessgeo.com/postgis-spatialdbtips/


0

It seems that MapFish accepts well WFS as GeoJSON, never tried that though: MapFish Printing Capabilities: WFS? Since you're using Geoserver, you can try GeoExplorer, it may easily work for you: http://workshops.boundlessgeo.com/suiteintro/geoexplorer/introduction.html Check this also out: How to edit using a WFS service, without showing it on the map ...


0

The best place to look is the online OpenLayers examples Here's an example of creating and modifying shapes.


0

Here is my own Ajax + GeoJSON + jQuery get layer data: GLOBAL VARS: var map; var unitsLayer; var fromProjection = new OpenLayers.Projection("EPSG:4326"); var toProjection = new OpenLayers.Projection("EPSG:900913"); INIT MAP function initMap() { map = new OpenLayers.Map( ... ); createUnitsLayer(); loadUnits(); } INIT LAYER ...


1

OpenLayers can reproject entire layer, but only at load time (from file or a server). Features added manually (using the addFeatures method) must have their geometries reprojected before adding to a layer.


3

Have a look at WMS Split for Leaflet.


0

I found a solution: http://jsfiddle.net/XfEmn/ detect the point clicked find the feature closest to this point use the selectFeatureControl to programatically select this feature


0

There're two examples that modify features in the documentation. One is http://ol3js.org/en/master/examples/modify-test.html and the other is http://ol3js.org/en/master/examples/modify-features.html


1

I have solved my problem. Perhaps not the best way... The solution was a "singleTile" option for every WMS-Layer. It was set always to true. With "singleTile: false" I solved my problem. Actually my problem with WMS "vector" layers persisted on all zoom levels. It was simply difficult to see this.


1

Before I come to your question, I'll like to explain something about commercial APIs like Google Maps API or the Bing Maps API. When you use the Google Maps API, you are actually getting 3 different things: Firstly, you are getting a JavaScript Library that you can use in your application or HTML Then you get access to a set of tiles, which are created by ...


1

If I understand correctly what you are looking for is something a bit like what is possible using Google Maps with its user added markers and lines. The reason that Google can do this is that they offer a service costing lots of money - but paid for by advertisers. OSM is different. There are disadvantages - and advantages. The fact that it's a lot harder ...


1

The full documentation for the above answer is at http://dev.openlayers.org/apidocs/files/OpenLayers/BaseTypes/Bounds-js.html


1

The documentation for the Bounds constructor says: bounds {Array(Number)} [left, bottom, right, top] So you need to provide these parameters as numbers var bounds = new OpenLayers.Bounds.fromArray([wms.min_x, wms.min_y, wms.max_x, wms.max_y]);


1

Should your code maybe be dojoMap.addLayer(townLayer); instead of map.addLayer(townLayer);


0

I don't believe you need to incorporate Google Maps with GeoServer. Instead, the Google Maps tiles will go straight into OpenLayers, with your own datasets coming from GeoServer. Something like this rough diagram: See the OpenLayers sample page for instructions on how to add Google Maps as a background layer: map = new OpenLayers.Map('map', { projection: ...


0

I was unaware that support for SVG fragment identifiers is not so hot, so I found somewhat of a workaround in the form of Base64 encoding (thanks to these doppnet and CSS Tricks posts). So, after optimizing my SVG in Inkscape I converted it to base64 using Mobilefish's converter (if you use this, make sure to set max characters per line to 0 so you don't ...


0

I'm not sure if this will fix your problem, but the projection information in the map file is, I think, incorrect. For example in the first PROJECTION declaration (as below), there should be just one projection, which should be the default projection for the service. MAP NAME "africa_southafrica_admin" PROJECTION "init=epsg:4326" ...


1

You would have to use WFS to get the effect you want. Unfortunately, I haven't looked at much version 3 code, but in version 2, you would create client-side default and highlight styles with an icon. You would then add a select control to the layer with "hover" set to true. Hope this gives you some ideas.


0

Actually, the trick is to patch the map's setBaseLayer() function. I have some code here, but it's rather old and I haven't had time to look at it properly. OpenLayers.Map.prototype.setBaseLayer = function(newBaseLayer) { var oldExtent = null; if (this.baseLayer) { oldExtent = this.baseLayer.getExtent(); if ...


1

To display the map, it is necessary to declare the projection of the data, and the projection you want to be displayed. The geojson data seems to be in EPSG:4326, while the OSM map you load is in EPSG:900913. My own osm map starts with map = new OpenLayers.Map ("map", { controls:[ new OpenLayers.Control.Zoomlevel(), ...


0

Try this code: mapPanel = Ext.create('GeoExt.panel.Map', { border: false, region: "center", map: { projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326"), allOverlays: false, controls: [new ...


1

Is the WMS layer in the same projection as the Google layer? If not, you will have to handle the LayerSwitch event and reproject the overlay to make it align with the different projection. Note that the OpenLayers devs don't recommend mixing base layer projections, but in practice it can be made to work.


0

Changing the geometryName property won't have any effect, because the geometry field is defined in the geoServer layer. Create two views which expose each geometry column: See here for an example. Then create layers in geoserver on each view. You can then programmatically change the source layer name in your WFS layer source and call refresh().


0

Using a Fixed strategy means that the entire layer loads all at once, which can cause trouble with some browsers if the layer has a large number of features. A BoundingBox strategy might be better, but this might not be an option with a GeoJSON protocol. In that case try changing to WFS. (Of course, if your map starts at the minimum zoom, the strategy won't ...


0

I don't think this is the cause of your problem, but you are misspelling maxResolution in your code. It might help you to use a tool like Fiddler or FireBug to look at the request urls of the WMS layer. For a start, check that the coordinates getting passed are in the correct projection.


0

You could make use of the built-in popup class in OpenLayers, doing something like this: var poSize = new OpenLayers.Size(<Width>, <Height>); var poPrompt = new OpenLayers.Popup('name', null, poSize, '', ...


0

Please can someone help me no longer know what to try I know the problem is in my WMS layer but do not know where. I was using Spherical Mercator projection and passing bounds in decimal degrees, already corrected this error and still did not work. I appreciate any help. <!DOCTYPE html> <html lang='en'> <head> <meta charset='utf-8' ...


0

Unfortunately, I don't for sure have the answer and my reputation is not high enough to just post a comment... But I will need to do something similar in my app and I found this as a possible clue/lead. http://stackoverflow.com/questions/4728852/forcing-an-openlayers-markers-layer-to-draw-on-top-and-having-selectable-layers As the answer here suggests ...


0

When a request is handled by GeoWebCache, it adds some custom headres to the response Check the http requests with firebug to see in the headers if the following header is present in the response: geowebcache-cache-result: HIT


1

For a simple way to add markers on top of an OSM based map: uMap This lets you add markers, or draw lines or areas on the map. You can import data from a GPX, KML, or GeoJSON file etc. It has a number of different tile layers to choose for the background map. You can share a link to the map if you want, or embed it another webpage. By default, any maps ...


1

That depends on what you want to achieve. How to render your own tiles is described on switch2osm. This step is only necessary if you want to change the style of the tiles. TileMill is another approach for rendering your own tiles, among many many others. If you are instead just interested in adding a custom overlay, then go for Leaflet or OpenLayers. ...


0

Mapbox is the answer to my question along with this nice tutorial: http://youtu.be/JUfLpFV1F4c Download TileMill from here to create your own layers to work with your MapBox projects. https://www.mapbox.com/tilemill/ Don't forget to sign up for http://mapbox.com to use their web app and make your own private maps


0

Having EPSG:4326 bbox coordinates I've managed to draw rectangle like this: boxes = new OpenLayers.Layer.Boxes("Boxes") coordinates = [boundingbox.left, boundingbox.bottom,boundingbox.right, boundingbox.top] bounds = OpenLayers.Bounds.fromArray(coordinates).transform(new OpenLayers.Projection("EPSG:4326"), new ...


0

A possible way of diagnosing these sort of problems is to firstly view the map in Internet Explorer. You can right-click on a tile and copy its url. Then paste the url into a new window. Hopefully you'll get some sort of error message that will allow you to fix the problem. You can also use Fiddler to intercept the calls to the map server and read any ...


0

There are several options I can think of, but there are probably more and better ways to do it. Depending on how many styles you need, you could create a new rule for each style you need. Set a filter on each type of style like this: <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>POI_TYPE</ogc:PropertyName> ...


0

If you want to avoid cross origin issue and dont't want use proxy then you have to open your web application from the same host and port as your wfs server. If your wfs server listens 8080 port on localhost that means URL of your web app should be http://localhost:8080/index.html for example (not file:///...). In your case you shoud publish your static files ...


1

It looks like you should publish your PostGIS layer as WFS service using GeoServer. How use OpenLayers.Editor for eding WFS layer see example. All you need is setup editLayer property of OpenLayers.Editor.


0

So I eventually got to the bottom of it, a slight bodge perhaps but to request legend images via the previously defined proxy I had to modify the GeoExt LegendImage.js file and modify the setUrl function (see the if statement at the bottom), specifically the el.dom.src = proxyUrl + encodeURIComponent(url) which set the src of the image to the proxy + already ...


2

The problem is in the way you are setting up the Image Layer. You are not providing all the required parameters. You need to provide the correct bounds of the image. You need to find out what the real bounds are in Web Mercator, and use those as well as the image's Size (i.e height and width), while setting up the layer. Please see this example on the ...


0

If your WMS and WFS are on the same server and the same server port then you will not need to set up a proxy. If you're just using a local WMS then you don't need a proxy, and your issue lies elsewhere. Have you tested that you can get a Map and FeatureInfo outside of OpenLayers? Do the bounds that you request in your code match the bounds you get when ...


0

I load a dynamic kml, with all popup ... dynamic kml is a php file that create a kml structure and where i put all information tha i need. KML is a file that I can define a style and pop-up message, with html format. I can simply add a various kml file to my OpenLayers map with this simple code: var sundials = new OpenLayers.Layer.Vector("KML ...


1

I tried your code example and it's working for me, I called it openlayers-example.html stuck it in my root folder next to the json1.json file and called it like http://localhost/openlayers-example.html. So you may need to double check that the json file is where you think it is and call it like: url: "http://localhost/json1.json" That said, I think ...


0

First thing GeoServer being a java webapp requires a container. The Windows installer, which is not meant for production use IMHO, contains an embedded version of Jetty which is a servlet container. That said, it is not GeoServer who is overlaying data onto GoogleMaps it is OpenLayers. I would suggest to split your concerns: -1- try a simple OL example to ...



Top 50 recent answers are included