georeference.org
Subscribe to this thread
Home - Scripting / All posts - ASP.NET Zoom To a Point in a Drawing
Eddie12333 post(s)
#17-Jul-08 07:10

I am trying to use ASP.Net and a Web application to select a point from a dynamically created drawing and zoom to it. I listed my attempt below but it does not work. The problem lies in zooming in to the point. It seems it requires an INT X,Y and all I can manage to get is a Lat/Lon. There may be another way to go about this, if so please help. Thanks in Advance.

Manifold.Interop.Query q = (Manifold.Interop.Query)mapServer.Document.ComponentSet["LoadTicketQuery"];

q.ParameterSet["pTicketNumber"].Value = (string)Request.QueryString["LT"];

q.Run();

Manifold.Interop.Drawing d = (Manifold.Interop.Drawing)mapServer.Document.ComponentSet["LoadTicketDrawing"];

d.SelectAll();

//Manifold.Interop.ObjectSet sel = d.Selection;

//Manifold.Interop.GeomSet geom = d.Selection.GeomSet;

//Manifold.Interop.Point pt = (Manifold.Interop.Point)geom.LastAdded;

//mapServer.Center((int)pt.X, (int)pt.Y);

Manifold.Interop.Drawing activeDrawing = d;

Manifold.Interop.ObjectSet currentSelection = activeDrawing.Selection;

if (currentSelection.Count > 0)

{

Manifold.Interop.Point geomPoint = currentSelection[0].get_Geom().Center;

mapServer.Center((int)geomPoint.X, (int)geomPoint.Y);

mapServer.ZoomIn(

}

atlasalive

135 post(s)
#17-Jul-08 07:39

I'd try:

mapServer.ViewCenterX = geomPoint.X;

mapServer.ViewCenterY = geomPoint.Y;


Distributed Geospatial Solutions -- makers of AtlasAlive Geo-Hosting Framework dennis@distributedgis.com

Eddie12333 post(s)
#17-Jul-08 08:56

I tried this an it has an affect but not the desired one. The map centers on the left bottom corner of the entire map. I am using the Virtual Earth Street Map. I checked the coordinates sent and they are in Northwest Florida.

cartomatic116 post(s)
#17-Jul-08 23:45

I use something like this and it works fine:

Dim drawing As Manifold.Drawing = MapServer.Document.ComponentSet("SelectedSpecies")

Dim Point As Manifold.Point

MapServer.Query(QueryName1, QueryParams)

Drawing.Refresh()

Point = drawing.Box.Center

MapServer.ViewCenterX = Point.X

MapServer.ViewCenterY = Point.Y

adamw


4,662 post(s)
#23-Jul-08 07:05

Convert the coordinates of the point to the coordinate system of the components served by the MapServer object prior to assigning them to ViewCenterX / ViewCenterY (using the CoordinateConverter object, there are several examples of using this object on this forum).

seekert55 post(s)
#18-Nov-08 05:23

Maybe in version 9 we have user friendly developers help.

With real, fully functional samples. Like in MSDN.

All in one plase.

Hell, I will pay additional $ for upgrade.

0 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.