Re: [OpenLayers-Users] Problem while adding a vector layer

2010-08-12 Thread Arnd Wippermann
Hi,

Your maxExtent defines a little area about 1x1 sqm at 0,0 because you use
spericalMercator.

Extent in EPSG:900913
maxExtent:new
OpenLayers.Bounds(9258442.0492536,1996037.9243878,9282932.3372281,2012982.98
40631)

Or transform your coordinates

maxExtent : new
OpenLayers.Bounds(83.170,17.645,83.390,17.790).transform(new
OpenLayers.Projection("EPSG:4326"), new
OpenLayers.Projection(map.projection))

Arnd


-Ursprüngliche Nachricht-
Von: users-boun...@openlayers.org [mailto:users-boun...@openlayers.org] Im
Auftrag von usha madhuri
Gesendet: Donnerstag, 12. August 2010 12:38
An: users@openlayers.org
Betreff: Re: [OpenLayers-Users] Problem while adding a vector layer


Hi,
I have used SphericalMercator and my code is as below, function load() { map
= new OpenLayers.Map(document.getElementById("map"));
OpenLayers.ProxyHost="/proxy/?url=";

var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
numZoomLevels: 18,
maxResolution: 156543.0339,
maxExtent: new
OpenLayers.Bounds(83.170,17.645,83.390,17.790)  
};
map = new OpenLayers.Map('map', options);

google = new OpenLayers.Layer.Google(
"Google Streets",
{'sphericalMercator': true}
);
map.addLayer(google);

using this I am not able to pan the map. Please tell me where have I gone
wrong.

Regards,
Madhuri
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Problem-while-adding-a-vector-layer-t
p4869632p5415604.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Problem while adding a vector layer

2010-08-12 Thread usha madhuri

Hi,
I have used SphericalMercator and my code is as below,
function load() {
map = new OpenLayers.Map(document.getElementById("map"));
OpenLayers.ProxyHost="/proxy/?url=";

var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
numZoomLevels: 18,
maxResolution: 156543.0339,
maxExtent: new
OpenLayers.Bounds(83.170,17.645,83.390,17.790)  
};
map = new OpenLayers.Map('map', options);

google = new OpenLayers.Layer.Google(
"Google Streets",
{'sphericalMercator': true}
);
map.addLayer(google);

using this I am not able to pan the map. Please tell me where have I gone
wrong.

Regards,
Madhuri
-- 
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Problem-while-adding-a-vector-layer-tp4869632p5415604.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


Re: [OpenLayers-Users] Problem while adding a vector layer

2010-04-12 Thread Eric Lemoine
On Thu, Apr 8, 2010 at 8:38 AM, usha madhuri  wrote:
>
> I am doing a project using Openlayers API with Google Maps as my base layer.
> I got a problem while adding a  vector layer(kml layer) or even just a
> linestring on google maps(base layer on openlayers API). The vector layer is
> not fixed with the map and moving while I am panning the map. I have tried
> different combinations but couldn't end up with a proper solution.

Hi.

You should use sphericalMercator. See:


Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users


[OpenLayers-Users] Problem while adding a vector layer

2010-04-08 Thread usha madhuri

I am doing a project using Openlayers API with Google Maps as my base layer.
I got a problem while adding a  vector layer(kml layer) or even just a
linestring on google maps(base layer on openlayers API). The vector layer is
not fixed with the map and moving while I am panning the map. I have tried
different combinations but couldn't end up with a proper solution.

This is my code for drawing a line:

http://www.w3.org/1999/xhtml";>
  

#map {
width: 762px;
height: 825px;
border: 1px solid black;
}

http://openlayers.org/api/OpenLayers.js";>
http://maps.google.com/maps?file=api&v=2&key=ABQIIeWnOWItAsdtOsR3kxiUQhTwM0brOpm-All5BF6PoaKBxRWWERSQAgEHUq2jStqEx-kpNgzntg87iw";>


 var result_style = OpenLayers.Util.applyDefaults({
 strokeWidth: 7,
 strokeColor: "#ff",
 fillOpacity: 0
 }, OpenLayers.Feature.Vector.style['default']);

function init() {
var map = new OpenLayers.Map('map');
var google = new OpenLayers.Layer.Google( "Google", { 
type: G_NORMAL_MAP}
);
var highlight = new OpenLayers.Layer.Vector("highlight", {style:
result_style});
map.addLayers([google, highlight]);
var parser = new OpenLayers.Format.WKT();
var wkt = "LINESTRING(-73.9444 40.75921,-73.96892 40.76396)";
var feature = parser.read(wkt);
highlight.addFeatures([feature]);
map.zoomToExtent(new
OpenLayers.Bounds(-74.0472500,40.6795100,-73.9071900,40.882));
}

  
  

  



code for adding a kml layer on google maps: 

http://www.w3.org/1999/xhtml";>
  

#map {
width: 762px;
height: 825px;
border: 1px solid black;
}

http://openlayers.org/api/OpenLayers.js";>
http://maps.google.com/maps?file=api&v=2&key=ABQIIeWnOWItAsdtOsR3kxiUQhTwM0brOpm-All5BF6PoaKBxRWWERSQAgEHUq2jStqEx-kpNgzntg87iw";>

 
function init() {
var map = new OpenLayers.Map(document.getElementById("map"));
OpenLayers.ProxyHost="/proxy/?url=";
map = new OpenLayers.Map('map');
google = new OpenLayers.Layer.Google("Google Streets", // the default
 {numZoomLevels: 20}
 );
map.addLayer(google);
map.setCenter(new OpenLayers.LonLat(83.30454509,17.72457397), 13);
mylayer = new OpenLayers.Layer.Markers("samplekml");
map.addLayer(mylayer);
 mylayer = new OpenLayers.Layer.GML("KML", "sample.kml",
   {
format: OpenLayers.Format.KML,
formatOptions: {
  extractStyles: true,  
  extractAttributes: true,
  maxDepth: 4
}
   })
map.addLayer(mylayer);

}


  
  

  


Can anyone help me out with this. I guess thats not gonna be a big problem
for experienced users or developers.
-- 
View this message in context: 
http://n2.nabble.com/Problem-while-adding-a-vector-layer-tp4869632p4869632.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
___
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users