Tag Info

Hot answers tagged

13

Every feature has a style property which is null by default because it inherits the parent vector layer's style. But you can set the style for each feature: DEMO DEMO LINK Code Example: var myFirstLineStyle = OpenLayers.Util.applyDefaults(myFirstLineStyle, OpenLayers.Feature.Vector.style['default']); myFirstLineStyle.strokeColor = "#ffffff"; ...


10

This demo takes in two coordinates and a color and will create a Geodesic line between them. DEMO LINK You can add lines by entering information into the form, OR programmatically like so: //Taj Mahal to Venice (San Marco) AddLineProgrammatically(new OpenLayers.LonLat(78.0447, 27.17461), new OpenLayers.LonLat(12.34014, 45.43338), "#006633"); //Roman ...


7

If you have to work with a Google base map, OpenLayers 2 will satisfy your needs. As stated in an OpenLayers 3 issue by @ahocevar, There will be no ol.source.GoogleMaps, unless Google change their policy and allow direct access to their map tiles. Your only chance to use Google wiht OpenLayers 3 is to make a base map without any controls with Google ...


7

You can serialize your data. To reproject the data when converting, you should pass the internal and external projection to the format class, then use that format to write out your data. var format = new OpenLayers.Format.GeoJSON({ 'internalProjection': new OpenLayers.Projection("EPSG:900913"), 'externalProjection': new ...


6

As the GIS SE tag descriptions note: OpenStreetMap (OSM) is data OpenStreetMap is a collaborative project to create a free editable map of the world. The data is free, and free of legal and technical restrictions. OpenStreetMap is often shorted to OSM. OpenLayers is a client viewer OpenLayers is a JavaScript library which implements an API for ...


5

Openlayers does not feature a Geocoding API. There are several questions here related to geocoding. Some of them specifically mention openlayers and geocoding (many do so with Google).


5

That is a very hard question to answer. OpenLayers 2 has been very successful and it is easy to find examples for just about everything. OpenLayers 3 is a total rewrite and uses the Google Closure toolkit which provides a number of useful services: code compression, event handling, cross browser support, etc. OpenLayers 3 also uses webGL rendering, when it ...


5

You need to take the ol.js file from the build directory. That means "../build/ol.js". There is a "ol-debug.js" file, too, which contains a uncompressed version of ol3.


4

If you use custom objects and properties in your GeoJSON, they are ignored when the object is read using GeoJSON format. You can clearly see this on line 115 of the GeoJSON.js source code. Since the properties are never read in the first place, it is not possible to get them in OpenLayers. There are multiple workarounds to get what you want. You could ...


4

Can you try reprojecting the shapefile (ie saving it again with a different CRS)? The one you posted is Lambert Conformal Conic, with a central meridian of 95 degrees. That pretty much matches what your image shows. I believe it is this projection (or at least this is close enough). For example, you could use OGR: ogr2ogr -t_srs EPSG:4326 -s_srs ...


4

Please check timeline plugin on GitHub. I am sure it will help you. It contains simple library to create a time related map with Open Layers. It supports cluster strategy (Open Layers.Strategy.Cluster) and time filtering. Currently it supports source data in GeoJSON or GeoRSS format.


4

The features of OpenLayers 3, which distinguish it from OpenLayers 2, seem to be described in a blog post entitled Hot new features in OpenLayers 3: It makes heavy use of the new capabilities of modern Web browsers (Canvas, WebGL) and opens a whole new world of possibilities like client-side vector rendering, integration of 3D data, and many more. ...


3

It sounds like you're quite new to web mapping, learning all of these technologies will take time (albeit a worthwhile investment). In the meantime, you could probably achieve your objectives in an afternoon using a hosted map publication platform like MangoMap. Disclaimer: I am the Founder of MangoMap.


3

Your code is working fine for me, once I do the following two: Use the full OpenLayers.js file. Use a properly configured proxy. Have you done this on your side? My Code is as follows: <script type="text/javascript"> var map; function init() { var bounds = new OpenLayers.Bounds( 145.19754, -43.423512, ...


3

Service parameter is mandatory for making requests to WMS services. Your URL should looks like: http://localhost:8080/geoserver/wms/filedata?request=GetCapabilities&service=WMS


3

you dont need to define any srs to your ArcGIS93Rest layer if your map projection and service projection is identical. var options = { projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326"), units: "m", }; the below code working is working as it should work. ...


3

As part of the WPS-GUI project that I did I created a WPS client "library" that closely models after the OpenLayers 2 interface. It uses JSONIX (http://confluence.highsource.org/display/JSNX/Jsonix) for the all OGC XML marshalling and unmarshalling. You can check it out here: https://github.com/boundlessgeo/wps-gui/blob/master/src/wpsclient.js


3

You need to write a custom control that does that thing. Ive written a tutorial on the topic, so check it out :) http://codentonic.net/2015/04/02/custom-openlayer-control/ if you have any questions feel free to ask me


3

You could try to use the move callback: var my_polygonhandler = OpenLayers.Handler.RegularPolygon; var polygonControl = new OpenLayers.Control.DrawFeature(circles, my_polygonhandler, { handlerOptions: { sides: 40 } }); polygonControl.handler.callbacks.move = function (e) { var linearRing = new ...


3

Polygon layers by default do not stay the same size when zooming further out because they represent an area. The only aspect that you will see for smaller polygons when zoomed out is just the outline. If you still want to represent the feature when zoomed far out one option would be to add a <PointSymbolizer> within the sld that will turn on at x ...


3

Here's an example of how to draw an arc by center point, radius, start angle, and end angle. Depending on the use case you have in mind this may be a viable option.


2

You can use Google Geocoder with OpenLayers, for an example see this post: How to use Google Maps V3 Geocode with Openlayers Disclaimer: as someone pointed out you might be in violation of their usage terms, but I'll leave that for you lawyer to figure out.


2

I would suggest that you go through the OpenGeo workshop: Introduction to the OpenGeo Suite Though this workshop deals with the Opengeo suite in particular, it has enough general advice and knowledge, to serve as a good starting point. Now let me try to answer your questions: How to publish these maps to any open webservices? The easiest way is to ...


2

I am not aware of this tool, and cannot find much mention of it outside the whitepaper you linked to. I think it is a proprietary toolbar, which may or may not be available for commercial use. This type of operation is often performed using FME, which has been improved in recent years to allow the creation of 3D buildings with different shapes, styles and ...


2

It seems that this functionality was recently added to the OpenLayers 3 examples. See Tile load events for a working example. Note the loading bar right below the map indicating how much it takes to load map tiles. You can also have a look at the code of the example and notice the use of tileloadstart, tileloadend, and tileloaderror events to handle the ...


2

At the moment I still prefer OpenLayers2. You can find a nice tutorial here: http://www.gistutor.com/openlayers/22-advanced-openlayers-tutorials/47-openlayers-wfs-t-using-a-geoserver-hosted-postgis-layer.html or even have a look at the "official" openlayers-example: http://dev.openlayers.org/releases/OpenLayers-2.13/examples/wfs-protocol-transactions.html ...


2

The easy way I use to set up styling is to load your dataset in QGIS and style it with that. Use only simple style features like colour and width and do it on a single attribute. The save that QGIS style as SLD, and copy paste that XML into GeoServer's style dialog. Trouble shoot that a bit to make sure it all came through, and you're good to go! You do ...


2

So you want to create a heavy and dated looking panel based map interface? /joking/ Personally I would use Leaflet and JQuery. Both are very lightweight but have a wide range of mature plugins that can deliver what you need in a lightweight and modular way. I don't think Bootstrap will be of much benefit. Map frames are pretty much responsive by default ...


2

From the API docs (http://openlayers.org/en/v3.4.0/apidoc/ol.Map.html?unstable=true#forEachFeatureAtPixel): To stop detection, callback functions can return a truthy value. map.forEachFeatureAtPixel(pixel, function(feature) { el.innerHTML += feature.get('Proj_Client') + '<br>'; return true; });


2

You could use St_Envelope on all your airports docs ! ST_Envelope — Returns a geometry representing the bounding box of the supplied geometry.



Only top voted, non community-wiki answers of a minimum length are eligible