openlayers

How to convert Vector Layer coordinates into Map Latitude and Longitude in Openlayers.

I'm pretty confused. I have a point: x= -12669114.702301 y= 5561132.6760608 That I got from drawing a square on a vector layer with the DrawFeature controller. The numbers seem...erm...awfull large, but they seem to work, because if I later draw a square with all the same points, it's in the same position, so I figure they have to b...

OpenLayers eraseFeatures doesn't erase features from map screen.

I'm using OpenLayers, and have a layer for my Map, and a single Vector Layer. In this vector layer, I am using the DrawFeature control to draw a square. I have a listener waiting for a feature to be added, and then deleting any existing features (I only want one square at a time), like so: polygonLayer.events.register("beforefeaturead...

Use single static image as map

I have a single image (a flattened out image of the world map), I want to be able to plot some coordinates in this image without having to create a map server or whatever per se, Idon't know where to begin, whats the easiest approach ...

OpenLayers Projections.

I can succesfully do: point.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326")); To a point that is in the google format (in meters), but when I want to do the reverse: point.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); to a point that is in 432...

Transportation Web App - utilizing google or bing map api

I have a MS SQL database with a table that stores geocoded "PICKUP" locations which I eventually may or may not want to display depending on search filters the user selects. These are not static like a brick and mortar store locations. They are added by the applications users 24 hrs a day. The life of a "LOAD" is less than 24 Hrs. Once i...

Open layers multiple mouseover events for multiple markers

I have the following loop inside an function init(); which is executed "onload", I am having traouble attaching the mouseover event for each marker, the alert i always returns the value of the final loop/iteration (228)? for(i=0; i<document.getElementById('departureSelect').options.length; i++){ var coords = eval(document.ge...

Change Projection in OpenLayers Map

I want to set "EPSG:4326" as the projection of an OpenLayers map, but when I try it, I always get "EPSG:900913". function init() { var options = { projection: new OpenLayers.Projection("EPSG:4326") // ignored }; map = new OpenLayers.Map('map', options); var layer = new OpenLayers.Layer.OSM.Osmarender("Osm...

openlayers, SVG and flash app

I would like to display a SVG layer (polygons) over the openlayers tiles in an html page, or alternatively, load my SVG in flash and have the OL tiles rendered into flash as well. Is any/either of these ideas possible at all? Thanks in advance ...

Interactive World Map, highlight countries on mouseover

I need to create an interactive world map on the front page of a site, the view portal will be about 650x200 pixels. The interactivity would include the following, mouse-over a country would highlight (the countries are will literally be filled with "red" for example) that country and display the countries' name (preferably text in a di...

Good examples of MapServer / OpenLayers

I want to convince some clients to use MapServer and OpenLayers. Please can anyone suggest attractive websites to show off the possiblities! The clients will be impressed by: A density map (otherwise known as a heat map, colour-shaded grid coverage, contour plot...). The ability for the user to download the underlying data for the ...

Drawing a path with a line in OpenLayers using JavaScript

I have seen the examples presented here of how to draw a line but the examples only show how to do it with the mouse, by clicking. What I want to do is draw the line manually using JavaScript given a list of Longitude and Latitude coordinates. The reason I cannot work on the source provided in the link above is because they are only ca...

Trouble with OpenLayers Styles.

So, tired of always seeing the bright orange default regular polygons, I'm trying to learn to style OpenLayers. I've had some success with: var layer_style = OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']); layer_style.fillColor = "#000000"; layer_style.strokeColor = "#000000"; polygonLayer = new OpenLaye...

OpenLayers, Bing and a KML

Hi! I'm trying to lay an KML over VirtualEarth Map in OpenLayers, but it doesn-t work. I guess it has to be something with the projection. Map: var options = { controls: [ new OpenLayers.Control.KeyboardDefaults(), new OpenLayers.Control.MouseDefaults(), new OpenLayers.Control.PanZoomBar(), ...

Rotate a feature programatically Open Layers

TLDR I want to rotate a Feature in my open layers. I want it to face a certain heading that I am receiving from server. I know that you can make a feature spin on a point or so on: window.setInterval(function() {rotateFeature( pointFeature, 360 / 20, origin)}, 100); as from the open layers example. But I want to be able to...

Openlayers - LayerRedraw() / Feature rotation / Linestring coords

TLDR: I have an Openlayers map with a layer called 'track' I want to remove track and add track back in. Or figure out how to plot a triangle based off one set of coords & a heading(see below). I have an image 'imageFeature' on a layer that rotates on load to the direction being set. I want it to update this rotation that is set in 's...

"Permission denied to access property 'href' from a non-chrome context" in JavaScript and OpenLayers

This is really two questions one leading into the other. Firstly what does 'Permission denied to access property 'href' from a non-chrome context' actually mean? Secondly I am using overlays in OpenLayers and wish to change the opacity of said layers, this is where this error is being thrown the code of which is here... <input id='opac...

OpenLayers, Layers: Tiled vs. single tile

Each time we add a new layer to our OpenLayers based website (data provided primarily by a GeoServer server), we discuss whether to use a single-tile or a tiled approach. Some of the parameters we evaluate are the following: Using the tiled approach we get: Slow but continuous buildup of the viewport Lots of small images Client sid...

How to Refresh / Reload a KML layer in OpenLayers. Dynamic KML Layer.

Here is an example on: How to Refresh / Reload a KML layer in OpenLayers. Dynamic KML Layer. See my answer below. TLDR See my answer below on how to refresh the layer. ...

IE8 is still caching my requests even with mathrandom.

TLDR IE is still caching my requests even with Math.random() included in the URL. So I added math random onto the end of my url: var MYKMLURL = 'http://' + host + 'data/pattern?key='+ Math.random(); I also added math random onto my function param: window.setTimeout(RefreshPatternData, 1000, MYKMLLAYER); function Refr...

Extjs Tooltips, IFrames and IE => Problems

I have an application using OpenLayers, Extjs and GeoExt. My application runs fine, but I need it to be placed inside an IFrame in another page. When doing this, my toolbar becomes responseless in Internet Explorer. The cause is Ext.QuickTips.init();. Comment out this line and everything works fine - except the quick tips ofcourse =) ...