[mapguide-users] Connecting MG with another app
Ryan Northcott
rnorthcott at gmail.com
Wed Feb 13 11:04:33 EST 2008
Hello,
I've done this exact scenario.. (using MapGuide Studio)
You can either build the URL manually, and store it in a Database field
Atttribute field, then point the Layer's URL to that property field in your
layer settings..
so for example, I have a SHP file loaded with an attribute field called
'URL' which contains: /AppPage.aspx?ParcelKey=123456
OR you can build the expression on the fly, using a field value from your
data.
So in the URL part of my Layer I used the expression builder to make this:
concat('http://www.domain.com/APP/AppPage.aspx?ParcelKey=', 0+"PARCELKEY")
where "PARCELKEY" is a field in my Map Data, and a unique identifier in my
Database application used to store the record in it's Tables.
the 0+ part remove the decimal places, so that the value returned is a long
integer. (this is from DBF converting of numerics when loading the data -
shapefile format)
This has actually made my javascript programming down to only one line of
code. Which I very much like, because converting the Sheboygam example was a
pain in the but to convert. I got it to convert, but I build many different
Maps for different clients, so re-coding for each was not an option I wanted
to go after.
Here's what I've done to get up and running quick. and it's been working
flawlessly.
Set my Task Page home page to a Map homepage through my ASP DB application.
This basically just allows the user to search the Web App for Parcels.
I've got a table in my system that links ParcelKeys to Map Handles (My
unique Map data identifier), as well as the X & Y locations for that Parcel.
So when a users searches the Database for a Parcel, it returns info from the
system for that parcel, and a link built on the fly to:
gotopoint.aspx?X=X_LONG&Y=Y_LAT&zoomScale=12000 , with a target to the
Script Frame
And when the user clicks that link the MapFrame refreshes centered on that
X/Y pair, with the Zoom Scale level I set. Depending on my Acreage size of
my Parcel, I sert different Zoom scales in the gotoparcel link I create.
Then, since the URL of the layer is built back to send a link to the Taxk
Pane, when the User control-Clicks a Parcel, the Tack Pane loads a new page
with Details specific to that Parcel being clicked. And because My Search
Page was set as the Task Pane Home page, clicking the Home icon returns the
user to the Parcel Search Screen.
So what this does in effect is bypass all the Javacript/ASP code I've have
to do to search the actual parcel through MapGuide.
The one thing it doesn't do that the Sheboygan Map example does do is
highlight the parcel when you Zoom to it on the Map. But this isn't really
a concern for me. Using the scale levels, and centering the map, usually is
enough for my users to find the parcel without problem (they are lablled).
There you have it. Simple and easy, and very little JavaScript to debug.
In fact the only Javascript code is in the gotopoint.aspx file which just
has an onload script send the X/Y, and scale to the Map.Frame.
If you need more info please let me know
-Ryan
On Wed, Feb 13, 2008 at 10:08 AM, lmbap <luisbap at hotmail.com> wrote:
>
> Connecting MapGuide with a different app
>
> Hi,
> i already searched but can't find what I'm looking for or maybe I just
> can't
> see it.
> What I want is when selecting an object in the map window, the task panel
> (which is running a different application) shows all information regarding
> that object. To show all that information I need to know the ID of the
> selected object in the map window
> My question is, how can I get the ID of the object selected in the map
> window to include it in the URL of the app running in the Task Panel?
>
> I would like to keep only with C#/ASPX but maybe I need to use some JSP.
> Can anyone point me some clue, some sample, some code, some documentation,
> some thing?
> Thanks in advance
> --
> View this message in context:
> http://www.nabble.com/Connecting-MG-with-another-app-tp15459488s16610p15459488.html
> Sent from the MapGuide Users mailing list archive at Nabble.com<http://nabble.com/>
> .
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20080213/c7b3da6d/attachment.html
More information about the mapguide-users
mailing list