How to change center point at first map loading?

Oct 13, 2008 at 8:29 AM

Hi, I'm just a beginner for SharpMap, and create my web-project to draw world map.

Now, i meet a problem. Defaultly SharpMap render world map center 0 in longtitude.

I got a question. How to change center point at first map loading?

^^v

Oct 13, 2008 at 12:49 PM
you can cet center properties of map varible

exm :

SharpMap.Map map;= InitializeMap(context.Request.Params["MAP"], new System.Drawing.Size(Width, Height));
map.Center = new SharpMap.Geometries.Point(centerX, centerY);
Oct 14, 2008 at 12:20 AM
Thanks to navid_pmb!
I solved the problem.
Thanks very~ ^^v
Nov 14, 2008 at 9:21 AM
Hello,

we have a problem with this solution.
We use the version 2.0 and there is no namespace called SharpMap.Geometries.

What is the solution for SharpMap 2.0?

Bye... vera...
Coordinator
Nov 14, 2008 at 12:49 PM
Hi vera,
Are you using the real v2 from googlecode? The one hosted here (codeplex for any one reading on an aggregator) should not be used until we have successfully transfered the data across - there have been issues doing this hence the limbo.

In v2 you would use an instance of an  IMapView to set the center point, there is a kind of demo in the source tree (incomplete and buggy)
 
hth jd