Tag Info

Hot answers tagged

67

Commercial APIs (Google,Bing, Yahoo) Using any commercial API leaves you at the mercy of whatever changes the provider makes to the API or Terms of Service. What happens for example if suddenly your local government portal that uses Google Maps suddenly has adverts popping up all over it? Want to reuse your JavaScript Google Maps code for an Intranet site? ...


37

There is a new player on javascript mapping front - Leaflet. Developed by CloudMade under BSD licence. Looks really promising. (Source) Update: Pretty exhaustive comparison of FOSS libraries by German Carrillo can be found here:


25

Go OpenLayers. I had a Google Maps / arcgis api project and about a year ago, i decided to try openlayers. The more i worked with it the more i saw how awesome it is. So i decided to migrate. I cut down 30 - 100 lines of google code into 1 - 3 lines over and over again throughout my code. Simply because openlayers had funtions for what i wanted to do and was ...


22

I would suggest downloading and installing QGIS. You can then open the file that you link to and export the data in variety of formats. The most common format for spatial data of this type is a shapefile which is one of the files that you linked to (TM_WORLD_BORDERS_SIMPL-0.2.zip). The reason that it is a zipfile is that there are several associated files ...


20

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: ...


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 :)


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

CartoDB is a tool for analyzzing, vizzualising and sharing your geospatial data in PostGIS. It's an open source geospatial database platform that provides an SQL API layer. It allows developers to make querys to a cloud PostrgreSQL + OpenGIS database optimized to geospatial purposes.


13

You could look at the OpenLayers API, particularly the Geometry classes. You can check for intersects, and have access to vertices etc. I've implemented point buffers in the past just with OpenLayers. Unions may be trickier though. For more complex operations you may want to do the processing server-side, and pass results back in WKT or GeoJSON, both of ...


13

Well, I coded something yesterday and released it under MIT License. The library, named geostats is available on github. The package includes examples. You will also be able to see it in action on http://www.empreinte-urbaine.eu/mapping/geostats/ (with a concrete choropleth representation sample). It supports the 8 methods listed above : Quantile Equal ...


12

One more time, you should also include Mapquery to your list (based on top of jQuery). Vmx clone seems to be particularly active. By the way, I would provide again Laurent Jegou's benchmark (PDF, french). It is a global outlook on web mapping solutions (both client and server). Regarding your need, it can be a good start to exclude some of them. edit June ...


12

I work on the JS API team and honestly, we could do a better job of documenting this. That being said, we support the browsers supported by the version of dojo we're using. The lastest versions of ArcGIS JS API (2.3 and 2.4) use dojo 1.6.1. The dojo 1.6 release notes list the supported browsers: http://docs.dojocampus.org/releasenotes/1.6 The only caveat ...


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

You need to call the API to update map size. http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.updateSize Here's how we do it window.onresize = function() { setTimeout( function() { map.updateSize();}, 200); } You can see we did a slight delay, and honestly I don't remember the exact reason why, but we had to give it a slight ...


12

If you are interested in an implementation look at jsts a Javascript implementation of the much used Java Topology Suite library -- depending on whether you prefer reading Javascript or Java, I suppose. A general idea of how the algorithm works. For points, it is trivial, you simply buffer them by a given radius. If you have multiple points, you will have ...


11

I'm pretty much done with my port of JTS which is a pure JS port and it's available at https://github.com/bjornharrtell/jsts At the current version (0.9.1) it supports the core functionality of JTS by which I mean predicates and overlays.


11

OpenLayers is the best IMHO. You can easily make WFS calls to an WFS service. If you want to just return data and not map features, you can also do this. Or map features without the data, or both. here are some examples: http://openlayers.org/dev/examples/getfeature-wfs.html http://openlayers.org/dev/examples/wfs-filter.html


10

This sample shows one method to monitor the extent and keep the user from panning beyond the established limits. http://arcscripts.esri.com/details.asp?dbid=16956


10

Don't forget OpenStreetMap. There are many map viewers that can display the OSM data. I.e. JMapViewer, MapPanel and JXMapViewer for Java applications. At least the last one can also display Google Maps in your application.


10

You need to add a few changes to get the required results: Add the sphericalMercator: true property to your Google layer so vector layers are shown correctly on top of your Google base layer (this is the reason for the shifting geometry). Add in the maxExtent property of your Google layer, otherwise the centre of the map will not be set correctly. The ...


10

For open source mapping solution, you can consider following: Mapping Server Platform - GeoServer Java based and open source. Works well in many production environments: Check : http://geoserver.org/display/GEOS/Welcome User manuals: http://docs.geoserver.org/stable/en/user/ Other option would be MapServer : http://mapserver.org/ Check the ...


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 ...


10

Yes. You are looking for the Geolocation API, here's a simple demo. Here is sample code from Dive Into HTML5 and HTML Rocks. Works great from web pages hosted on iOS and Android phones, it's a simple API to use. Strictly speaking it's not GPS; it's a generic location API. On mobile devices like iPhones location is often provided by WiFi or cell tower fixes ...


9

I compare (with highlights & notes) the code required to do a simple, specific & common task in: MapQuest Google Maps bing Ovi Esri OpenLayers jQuery Geo here: http://trippingthebits.com/geopres/ The post is for a presentation I gave on jQuery Geo, which is sadly missing from your list.


9

I don't think regular expressions will help you here, because its designed for pattern matching rather than semantic interpretation, so your string.split() function will probably do as well. But without a database to compare each token against, it'd be pretty hard to determine what level a token represents. If, for instance the right-most token is Zealand, ...


9

you can convert pixels to lat/long with the help of getLonLatFromPixel() function. See also openlayers FAQ.


9

You can use register event loadend on your layer. More on: http://dev.openlayers.org/docs/files/OpenLayers/Events-js.html#OpenLayers.Events.on You should call this that: newLay.events.on({"loadend":loadEndListener}); I make it a long time ago, but probably that should work. On another site I found that should be tilesloaded listener, but I don't check ...


9

The trick of using the "myData" parameter should be unnessesarry, as we see in the OpenLayers.Layer.HTTPRequest (which the WMS layer inherits from): redraw: function(force) { if (force) { return this.mergeNewParams({"_olSalt": Math.random()}); } else { return OpenLayers.Layer.prototype.redraw.apply(this, []); } }, if you do ...


9

GetFeature control designed for retrieve features from a server and fires events that notify applications of the selected features. In your case you should use SelectFeature control: selectFeature = new OpenLayers.Control.SelectFeature( vectorLayer, { onSelect: clickNotice, autoActivate: true } ); map.addControl(selectFeature); ...


9

yes you can set the scale in the constructor: for example: var layer = L.tileLayer("http://{s}.tile.page.com/map/{z}/{x}/{y}.jpg", { minZoom: 1, maxZoom: 14 } ) ; vectors don't have max/min properties, you could use a zoomend event to trigger adding or removing them, something like: map.on('zoomend ', function(e) { if ( ...



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