background preloader

Geography

Facebook Twitter

Marker - OpenLayers. OpenLayers Tutorial – Place a Marker - Spatial Horizons. March 27th, 2011 This post continues our series of OpenLayers tutorials. If you are new to OpenLayers, review our basic map setup tutorial before continuing. A common task of any mapping application is to place a marker at a specified location. OpenLayers provides several options for doing this but we will focus on using a Marker. Our simple example will allow a user to plot the location of various US cities on an OpenLayers map. <select id="jumpTo" onchange="jumpTo();"><option value="NA">=== Select a City ===</option><option value="-84.42,33.65">Atlanta</option><option value="-104.87,39.75">Denver</option><option value="-95.35,29.97">Houston</option><option value="-81.32,28.43">Orlando</option><option value="-121.50,38.52">Sacramento</option><option value="-95.62,39.07">Topeka</option></select> Each <option> uses the value attribute to store the city’s coordinates.

We also added a javascript function call jumpTo that is called when the selected value is changed. Comparison of JavaScript mapping libraries. 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? You'll find yourself having to pay the $10,000 licencing fee.

Microsoft often have more defined and fixed terms for their services (if paying) so there may be less of a risk here. The recent backlash against Twitter is a good example of developers having an API that changed beneath them. Update - Google starts charging for use of their maps from October 2011. As others have mentioned if you are using an ESRI stack then the ESRI JavaScript API will no doubt work well on top of it.

Use OpenLayers... I can't really think why developers would use an API other than OpenLayers. Scan the API documentation for Leaflet and OpenLayers. Caveats. Thematicmapping.org. Download data for the whole world | Global Administrative Areas. Mapping Mashups with the JXMapViewer. In the last few years, mapping technology has advanced to the point where one can combine worldwide street maps with photos, videos, satellite images, and even " locations. Thanks to the JXMapViewer, you can bring mapping technology into your own desktop Java applications. In the article " " Building Maps into Your Swing Application with the JXMapViewer," I showed you how to build a simple mapping application using theJXMapKit, a prefab version of theJXMapViewer.

In this article we will customize theJXMapViewer with graphic overlays, polygons, rollovers, and a custom map server, and then build a mashup with an external web service to search Wikipedia. This article will not cover how to download theJXMapViewer .jars and build a basic mapping application. "Figure 1. Basic desktop Java application with JXMapKit in the NetBeans form editor" /> Figure 1. GMap.NET - Great Maps for Windows Forms & Presentation. GeoScript — GeoScript. Kartograph – rethink mapping.