ArcGIS for javascript: GraphicsLayer and arcgisjavascript

Source: Internet
Author: User

ArcGIS for javascript: GraphicsLayer and arcgisjavascript

1) first obtain the plane coordinate, and instantiate the coordinate object based on the corresponding coordinate system, as shown below:

Var point = new esri. geometry. Point (xpoint, ypoint, new esri. SpatialReference ({wkid: 4326 }));

The value after wkid must select the Coordinate System Standard corresponding to the current GIS, not necessarily 4326!

2) instantiate the content Template

Var infoTemplate = new esri. InfoTemplate (content, "<a href = 'javascript: showDetail () '> View Details </a> ");

3) instantiate graphical symbols

Var symbol = new esri. symbol. PictureMarkerSymbol ("images/red.png", 25, 25 );

4) instantiate Basic Elements

Var graphic = new esri. Graphic (point, symbol, null, infoTemplate );

5) instantiate GraphicsLayer

GraphicLayer = new esri. layers. GraphicsLayer ();

6) add elements to the Image Layer

GraphicLayer. add (graphic );

7) center the current Coordinate

Map. centerAt (point );

Note: Sometimes the center effect is invalid because the third coordinate system parameter of Point is incorrect. Therefore, you must first understand the coordinate system of the GIS layer!


How to configure arcgis for javascript

Have you checked this online?
 
Is arcgis api for javascript the same as arcgis Javascript api?

One thing, after 10.0, it was changed. for example, it was originally arcgis flex viewer and now arcgis viewer for flex...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.