[mapguide-users] Reference Map

acumen manish at geointelligent.com
Wed Apr 18 04:23:27 EDT 2007


Could u  explain clearly how u did it..becoz i also wanted to put reference
map on my project...but i dont know how to do it..if possible u can direct
me how to do it step by step...





Adrià wrote:
> 
> I have been searching the list and found some ideas to add a reference map
> to the web layout. We made a first approach that can be seen in action 
> http://213.195.75.242:8008/mapguide/viewertest/ here . It is not intended
> to be stable or in its final form, so comments, ideas and criticism will
> be appreciated. We hope it would be helpful.<br/>
> This is a summary of the steps we followed to add it, :
> <br/>
>  <ol>
> <li>Copies of mapframe.php and ajaxmappane.templ were made
> (mapframeref.php and ajaxmappaneref.templ). In ajaxmappaneref.templ
> everything except the map image was hidden (legend, properties, slider,
> etc.) and a couple of functions were added:
> <pre>
> function drawMainMapExtent(X1,Y1,X2,Y2) {
> 	var p1,p2;
> 	p1 = MapToScreenUnits(X1,Y1);
> 	p2 = MapToScreenUnits(X2,Y2);
> 	
> 	return ShowMainMapExtent(p1.X,p1.Y,p2.X,p2.Y,true);
> }
> function ShowMainMapExtent(x1,y1,x2,y2,show) {
>     var rcFrame = document.getElementById("rcFrame");
>     if(show){
> 			try {
> 	        rcFrame.style.position = "absolute";
> 	        rcFrame.style.left = (x1 + mapPosX) + "px";
> 	        rcFrame.style.top = y1 + "px";
> 	        rcFrame.style.width = (x2 - x1) + "px";
> 	        rcFrame.style.height = (y2 - y1) + "px";
> 	        rcFrame.style.visibility = "visible";
> 	        rcFrame.zIndex = 20;
> 	        return true;
> 	    } catch (e) {
> 	    	return false;
> 	    }
>     } else {
>     	rcFrame.style.visibility = "hidden";
>     	return true;
>     }
> }
> </pre>
> </li>
> <li>A new frame was added in framesettaskbar.templ, in the top of the task
> area. mainframe.php was modified to receive a new parameter, the
> MapDefinition used in the reference map. When building the viewer,
> mainframe.php loads mapframeref.php in this frame, with the Map definition
> passed as parameter and false values for SHOWLEGEND, SHOWPROP, etc</li>
> <li>In mainframe.templ a function was added to fire the extent drawing in
> the reference map:
> <pre>
>  function OnExtentChanged(X1,Y1,X2,Y2) {
>   	if (X1 && Y1 && X2 && Y2) refMap.drawMainMapExtent(X1,Y1,X2,Y2);
>   }
> </pre>
> </li>
> <li>Finally, in ajaxmappane.templ, on at the end of the OnMapRequested()
> function, we call OnExtentChanged()
> <pre>
> parent.OnExtentChanged(extX1, extY1, extX2, extY2);
> </pre>
> </li>
> </ol>
> 

-- 
View this message in context: http://www.nabble.com/Reference-Map-tf3589380s16610.html#a10054306
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list