Tag Info

Hot answers tagged

42

I have seen this technique used in the past. It was explained to me by Zain Memon (from Trulia) who helped giving some input when Michal Migurski was creating TileStache. Zain went over it while explaining his Trulia demo that uses this technique at one of our older SF GeoMeetup meetings some time back. In fact, if you are in SF next week (this is my lame ...


34

This has been an annoying problem for a while, and hopefully will no longer be an issue. 3857 looks to be the current and correct code (I hope, that's what all my tile caches are in!). Update 9/7/11 - as noted by Vadim below in comments, Esri did in fact revert back to 102100 from 3857 at Service Pack 1. Oddly, ArcGIS Server with SP1 applied returns a ...


28

I have used both OpenLayers and Leaflet in my apps. There has been so much discussion on this topic in this forum and others on planet-internet. They usually fall into 2 camps - features and flexibility of OpenLayers versus simplicity of Leaflet. I would not be surprised if someone spawns an "OpenLeaf" initiative soon marrying the best of both worlds! I ...


27

I don't have a definitive answer for you but you I put together a page where you can play around with different numbers of points on an OL map: http://swingley.appspot.com/maps/olpts


26

Creating and adding a vector feature to a layer: var points = [ new OpenLayers.Geometry.Point(0, 0), new OpenLayers.Geometry.Point(0, 100), new OpenLayers.Geometry.Point(100, 100), new OpenLayers.Geometry.Point(100, 0) ]; var ring = new OpenLayers.Geometry.LinearRing(points); var polygon = new OpenLayers.Geometry.Polygon([ring]); // create ...


21

It seems that you can directly access the googlemap object using layer.mapObject (source: http://openlayers.org/blog/2010/07/10/google-maps-v3-for-openlayers/#comment-34465). Refer to gmap API to style the layer: http://code.google.com/intl/fr/apis/maps/documentation/javascript/maptypes.html#StyledMaps Here is a small example page I have created: ...


19

Answer to 1st question is Yes. You're using OL with a pretty much common configuration. There are tricks you can use to improve performance, I'll get to that later. Answer to question 2 is maybe (especially with regards to fastness). You can search this site for a list of alternatives (one that springs to mind right now is Leaflet). Answer to question 3: ...


18

Direct from the developer Dino Ravnic on a recent mailing list post: It's not a big secret how we did it so I would be happy to share that with you..the key is in two things: removing from a tile all vectors which are to small to be visible i.e. their area when calculated into pixels is less than 1px. so we drop such a vector and instead ...


17

Add 2 base layers to the map Subscribe to the map's zoomend event map.events.register(type, obj, listener); http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.EVENT_TYPES Check the zoom level and just switch the base map for your user map.setBaseLayer( layerRef ) ...


17

If you want a clusterer like redfin then check out my Leaflet.markercluster: http://danzel.github.com/Leaflet.markercluster/example/marker-clustering-realworld.388.html https://github.com/danzel/Leaflet.markercluster It is fully animated etc etc :)


17

When you define your layer you could specify your styleMaps as well: _layer = new OpenLayers.Layer.Vector("My Layer Name", { styleMap: new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ strokeColor: "#ff0000", strokeOpacity: .7, strokeWidth: 1, fillColor: "#ff0000", ...


15

In order to use scales on your map: Set only the 'scales' option. Do not set maxResolution, minResolution, maxScale, minScale, numZoomLevels, or any other scale related property. Set it to an array of scale denominators (or scales). Configure a unit: note that for meters, this should be 'm', for degrees, 'degrees', etc. You can set a maxExtent. Do not set ...


15

Setting the z-index for each layer should help: http://www.openlayers.org/dev/examples/ordering.html EDITED The example I originally linked to isn't too helpful. You want to set the layerindex/z-index of the layers, not the makers within the layers (as the ordering example showed). I put together an example (based off this example) showing custom layer ...


15

First of all, I think you should read the Geoserver documentation on Security. http://docs.geoserver.org/stable/en/user/security you will discover it is possible to make layers accessible/inaccessible to different users or roles. Another possible solution would be to make geoserver inaccessible from the outside world (close port 8080 on your server for IP's ...


15

OpenLayers, as a project, started with a notion of "documentation by example". That is, the primary documentation for many aspects of the code is the almost 200 examples that we make available, with full code to back them. This is typically the first resource to go to for any documentation needs. After that, we expanded to API documentation. This was an ...


14

I don't think that OpenLayers is capable of removing a feature by providing the featureID. It seems like it can only remove a features by providing a feature or an array of features: layer.removeFeatures(featureObject); But you could instead locate the feature first and then remove the found feature: layer.removeFeatures(layer.getFeatureById(featureID)); ...


14

Take a look at my answer on this post. Make sure your featureNS value is in the "Edit Workspace Page under Namespace URI" in your GEOSERVER. Do not use something as generic as "http://postgis.org". Use something like "http://yourdomain/application/catalogLayer" or something unique like that. You can make this URI up, just make it unique. You ...


13

As I described on the OSGeo list the key is in delivering data as vector JSON tiles that have pixels for subpixel geometry and generalized geometry for those features that will be actually visible on a certain level. Performance is great because this technique eliminates all unnecessary vector information and leave only those vectors that will actually have ...


13

The only projection for which any straight line corresponds to a great circle is the Gnomonic projection. Additionally, any straight line drawn through the center of a map in any azimuthal projection (of which the Gnomonic is one) will be a great circle. In azimuthal projections, distances can be (but are not necessarily) preserved along lines passing ...


13

For geometry manipulation on client side you can use JSTS Topology Suite. Here is my little example of solving your problem: Union example. Source code: var reader = new jsts.io.WKTReader(); var a = reader.read('POLYGON((10 10, 100 10, 100 100, 10 100, 10 10))'); var b = reader.read('POLYGON((50 50, 200 50, 200 200, 50 200, 50 50))'); var union = ...


13

I saw this answer on the Openlayers mailing list a few days ago. You need to make sure you are providing a version, such as v=3.6: <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&v=3.6"></script> Then it should disappear. -- May 17, 2012 edit: I just saw that this problem has returned on the ...


13

The reasons why it is so slow is you retrieve megabytes of data doing your WFS request. To confirm, open Firebug (Firefox addon debugger) or Chrome and look into Net(work) panel. You will see it's too huge. This data takes time to be process (your "page is unresponsive" syndrom) browser capabilities: you never display more than one thousand of feature in ...


12

I have had some projects with either of them. In addition to the the obvious data service/source difference there are some practical considerations. OpenLayers advantages: more flexible can use almost any data source - even Google/Bing and others via API wrappers no dependency on one map provider ToS no usage restrictions (e.g. Google Maps for Intranet ...


12

The best thing about open source is that you can see exactly what is going on by browsing the source code. When constructing a spatial filter, a new object is initialised with the following initialize function: 72 initialize: function(options) { 73 OpenLayers.Filter.prototype.initialize.apply(this, [options]); 74 }, This can be seen in ...


12

For a simple way to do this starting with QGIS you could use QGIS Mapserver which can serve maps that you design using the normal QGIS interface. Alternatively you might want to go with GeoServer which is Java based and probably easier to install. Since both programs serve maps using open standards if you start with one and need to switch later there is no ...


12

There exists no map of the entire earth in which all (true, spherical) circles remain truly round. However, there are ways of mapping the earth in which almost all sufficiently small circles are round. These are based on conformal projections. By definition, the changes that a conformal projection makes to distances within small areas are of two types ...


12

Looks like a very similar question was recently asked on the OSGeo Open Layers forum, with the GIS Cloud developers describing their approach, which is a interesting mix of GeoJSON geometries and static pixels. They actually generate all vector tiles on the fly instead of using a pre-built cache of GeoJSON files. Esri has implemented a similar approach, ...


12

Rasters are images, so the best format will be an image format (png/jpg/etc). Geojson is a good format for vectors. You will never see, say, your facebook profile pic be transported back as pure json. Of course, returning a url to an image as json is very very different :) As far as the jpeg vs png vs any other image format discussion, there are tons of ...


12

Im a big fan of "preFeatureInsert".... veclayer = new OpenLayers.Layer.Vector("vector", { projection: map.displayProjection, preFeatureInsert: function(feature) { feature.geometry.transform(projWGS84,proj900913); } };


12

I think you should glance at Cartaro - Geospatial CMS which consists of all the tech. you use... I haven't used it but it looks like it was developed for gisCMS. The main features of Cartaro are: (from its site) Spatial data storage with true geometry data types Creation of data types from within the Drupal GUI Integrated online editing of ...



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