|
POST
|
vJones, Only my county displays because I am using my map services not esri's and I don't have any other data than my county in those map services.
... View more
08-20-2010
11:12 AM
|
0
|
0
|
1748
|
|
POST
|
vjones, This is definitely not going to be a cake walk especially for a flex beginner but here is a link to what I think you are after. http://thunderheadxpler.blogspot.com/2009/01/constraining-map-extent.html
... View more
08-20-2010
10:31 AM
|
0
|
0
|
1748
|
|
POST
|
Tyler, You have to use a GeometryService and the labelPoints function to do that look at this sample http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=LabelPoints
... View more
08-20-2010
10:23 AM
|
0
|
0
|
548
|
|
POST
|
Brendan, Now you will not be able to use my whole code word for word as I do things with the Flexviewer2.0 that you will not have but here is my code and it works fine. Maybe you can see where you are going wrong.
<?xml version="1.0" encoding="utf-8"?>
<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:viewer="com.esri.viewer.*"
xmlns:esri="http://www.esri.com/2008/ags"
xmlns:mxeffects="com.adobe.ac.mxeffects.*"
layout="absolute"
creationComplete="addStatList()">
<fx:Declarations>
<esri:GeometryService
id="geometryService"
concurrency="last"
fault="onFault(event)"
projectComplete="projectCompleteHandler(event)"
url="http://gis.calhouncounty.org/arcgis2/rest/services/Geometry/GeometryServer"/>
<esri:SimpleMarkerSymbol id="smsPoint" style="square" color="0xFFFF00" size="11" alpha="0.9">
<esri:SimpleLineSymbol color="0x000000"/>
</esri:SimpleMarkerSymbol>
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeometryServiceEvent;
import com.esri.ags.events.MapMouseEvent;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
import com.esri.viewer.AppEvent;
import com.esri.viewer.ViewerContainer;
import mx.controls.Alert;
import mx.managers.CursorManager;
[Embed(source="assets/images/gsv_cursor.png")]
private var crosshairCursor:Class;
private var theStatus:String = "";
public function google():void{
setMapAction("","Show Google Street View",null);
map.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
map.panEnabled = false;
map.cursorManager.setCursor(crosshairCursor, 2, -8, -12);
}
private function mouseDownHandler (event:MouseEvent):void
{
if(theStatus == "Show Google Street View") {
map.cursorManager.setBusyCursor();
var mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY);
var outSR:SpatialReference = new SpatialReference(4326);
geometryService.project([mapPoint], outSR);
} else {
map.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
}
}
private function widgetClosedHandler(event:Event):void
{
map.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
map.panEnabled = true;
map.cursorManager.removeCursor(map.cursorManager.currentCursorID);
setMapNavigation(null, null);
}
private function widgetOpenedHandler(event:Event):void
{
google();
}
private function addStatList():void
{
ViewerContainer.addEventListener(AppEvent.SET_STATUS, statusSet);
theStatus = "Show Google Street View";
}
private function statusSet(event:AppEvent):void
{
if (event.data)
theStatus = event.data as String;
}
private function projectCompleteHandler(event:GeometryServiceEvent):void
{
var geom:Geometry = (event.result as Array)[0];
var mapPoint:MapPoint = geom as MapPoint;
var lng:String = mapPoint.x.toFixed(12);
var lat:String = mapPoint.y.toFixed(12);
// launch street view
var url:String = "http://gis.calhouncounty.org/FlexViewer2.0/StreetView.html?lat=" + lat + "&lng=" + lng;
var window:String = "StreetView";
var features:String = "toolbar=no,location=no,resizable=no,directories=no,status=no,scrollbars=no,copyhistory=no,width=610,height=700";
var WINDOW_OPEN_FUNCTION : String = "window.open";
ExternalInterface.call( WINDOW_OPEN_FUNCTION, url, window, features );
}
private function onFault(info:Object, token:Object = null):void
{
Alert.show(info.toString(),"Streetview Error");
}
protected function button1_clickHandler(event:MouseEvent):void
{
ViewerContainer.showError("This is a test error");
}
]]>
</fx:Script>
<viewer:WidgetTemplate id="wTemplate"
closed="widgetClosedHandler(event)"
open="widgetOpenedHandler(event)"
creationComplete="google()"
skinClass="com.esri.viewer.skins.WidgetTemplateSkin"
height="280"
width="370">
<mx:VBox width="100%" height="100%"
verticalGap="4"
horizontalAlign="center"
verticalAlign="middle" >
<mx:HBox width="100%"
horizontalGap="15"
horizontalAlign="center"
verticalAlign="middle">
<mx:Text id="selectPointLabelText"
text="Click location on the map to open Google® streetview panorama"
styleName="WidgetText" width="90%" textAlign="center"/>
</mx:HBox>
<mx:Button click="google()" label="Reactivate..."/>
</mx:VBox>
</viewer:WidgetTemplate>
</viewer:BaseWidget>
... View more
08-20-2010
07:36 AM
|
0
|
0
|
3737
|
|
POST
|
guys, Does your projection complete look something like this/ var geom:Geometry = (event.result as Array)[0];
var mapPoint:MapPoint = geom as MapPoint;
var lng:String = mapPoint.x.toFixed(12);
var lat:String = mapPoint.y.toFixed(12);
// launch street view
etc etc
... View more
08-20-2010
04:37 AM
|
0
|
0
|
3737
|
|
POST
|
Manolo, I would agree that it is a spatial reference issue. Have you tried to set the IdentifyParameters spatial reference?
... View more
08-18-2010
04:53 AM
|
0
|
0
|
856
|
|
POST
|
Manolo, If you go to the REST service page for that map service http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer You will notice that it does not support identify Supported Operations: Export Map Generate KML Ones that support identify will have Supported Operations: Export Map Identify Generate KML
... View more
08-18-2010
04:19 AM
|
0
|
0
|
856
|
|
POST
|
Tom, Here is the link Be advised that this is not a simple thing to add... http://forums.esri.com/Thread.asp?c=158&f=2421&t=299116&mc=139#934330
... View more
08-18-2010
04:12 AM
|
0
|
0
|
2127
|
|
POST
|
Sabgeetha, This topic has been talked about here http://forums.arcgis.com/threads/8501-Navigation-controls-in-FlexViewer-2
... View more
08-18-2010
04:04 AM
|
0
|
0
|
1130
|
|
POST
|
Shaf, The file is not damaged this is a known issue with this forum when you try to use Internet Explorer to download a zip file. Try and use Firefox or Google Chrome instead. Also be warned that this is not something that is easy to implement even for a non-beginner in Flex.
... View more
08-17-2010
03:19 PM
|
0
|
0
|
2068
|
|
POST
|
Jason, Well there is no error in your LiveMapsWidget.mxml as I took it and only changed the url of the wsdl and it worked just fine for me when I used your code in my viewer. When you tested the asp.net web service on your server as I mentioned in my previous email did you happen to copy one of the image urls and test to see if it displayed and image when you put it in a browser? Also have you put http://AFR112PROD4/restLegend/restLegend.asmx?wsdl in a browser and seen it bring up the wsdl file for your to see?
... View more
08-17-2010
03:16 PM
|
0
|
0
|
2068
|
|
POST
|
Sree, I am not sure what is going wrong either here is all I have in my mouse down event handler
var mapPoint:MapPoint = map.toMapFromStage(event.stageX, event.stageY);
var outSR:SpatialReference = new SpatialReference(4326);
geometryService.project([mapPoint], outSR);
... View more
08-17-2010
03:00 PM
|
0
|
0
|
3737
|
|
POST
|
Jim, Look at this link http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16359
... View more
08-17-2010
12:47 PM
|
0
|
0
|
1025
|
|
POST
|
Josh, Look here http://forums.esri.com/Thread.asp?c=158&f=2421&t=286723&mc=53#890948
... View more
08-17-2010
06:58 AM
|
0
|
0
|
689
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-14-2020 11:36 AM | |
| 17 | 05-17-2021 01:51 PM | |
| 1 | 07-06-2020 05:32 AM | |
| 1 | 07-10-2018 05:49 AM | |
| 9 | 01-28-2022 10:58 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-08-2026
06:27 AM
|