How to capture and send a point to Google Maps

Point capture is used to send a point click on the map to an external web page. There are generally two uses for this, to create a point and to update a point.

Adding Point Capture

IMPORTANT NOTE: the function on this page is added as custom command buttons to the map toolbar. See that article for how to add such a button.

Under the Settings tab, enter the following (you can change these values if you wish):

Command name: Create Point
Name to display in the interface: Create Point
Tool tip to appear on the hover: Create Point
Description to appear on the status bar: Create Point
URL to an image for enabled state: ../stdicons/icon_restorecenter.gif
URL to an image for disabled state: ../stdicons/icon_restorecenter_disabled.gif

Under the Additional Parameters tab, enter the following under Script to invoke:

    'http://maps.google.com/?ll={y},{x}&z=14&output=embed',
    'Infobar|Report|NewBrowser',
    'MCS|LatLon',
    'MsgTitle',
    'MsgLoad',
    'MsgClick',
    'MsgButton'
);

Script Parameters

WSD.CapturePoint(
   
'url',
    'target',
    'CoordinateType',
    'MsgTitle',
    'MsgLoad',
    'MsgClick',
    'MsgButton'
);

Description of Parameters

URL: The destination page to pass your point coordinates, where {x} will be replaced with either the MCS-x/longitude and {y} will be replaced with either the MCS-y/latitude (depending on the CoordinateType parameter). Some examples:
If {x} and {y} are not in the URL parameter string, an error will be thrown.

Target: Either 'Infobar', 'Report' or 'NewBrowser'
CoordinateType: Either 'MCS' or 'LatLon' for mapping coordinate system or latitude/longitude
MsgTitle: optional title of the point capture page
MsgLoad: optional message shown to the user when the point capture page first appears
MsgClick: optional message shown to the user when the user clicks on capture button
MsgButton: optional text on the capture button

Note that if you pass an optional parameter, all optional parameters must be passed. 

Using Google Street View in the Report Pane

WSD.CapturePoint('https://maps.google.com/maps?q=&layer=c&cbll={y},{x}&cbp=12,0,0,0,0&ie=UTF8&source=embed&output=svembed', 'Report', 'LatLon', 'Google Street View', 'Loading Google Street View', 'Select Point on Map', 'Select Street View Point');


Updating Existing Points

 To update (move) an existing point, you will want to create a data definition that has the key value information for the point data that you want to move. From there, manage the data properties for that data definition and create a custom URL link that passes to “CapturePoint.aspx” with the above parameters (the parameter names are the same). Additionally, all other information passed using the standard property passing (using {property name}) will be passed as well. Generally you will want to pass the unique key value for that point. 

Note that the URL parameter must be URL Encoded (since it itself contains the ‘?’ and ‘&’ characters for the x and y parameters).

CapturePoint.aspx?URL=http%3A%2Fmaps.google.com/%3Fll=%3Fll%3D%7By%7D%2C%7Bx%7D%26z%3D14&Target=Infobar&CoordinateType=MCS&land_id={land_id}&DSLFile={DSLFile}

 At this point, when a user clicks on a single item of the appropriate key value, they will have a hyperlink that will allow them to update the point via an external page. You may also pass the optional parameter (MsgTitle, MsgLoad, MsgClick, MsgButton). 

CapturePoint.aspx?URL=http%3A%2Fmaps.google.com/%3Fll=%3Fll%3D%7By%7D%2C%7Bx%7D%26z%3D14&Target=Infobar&CoordinateType=MCS&land_id={land_id}&DSLFile={DSLFile}&MsgTitle=TheTitle&MsgLoad=LoadMe&MsgClick=ClickMe&MsgButton=TheButton


Be careful not to use any wording that might be incompatible in an URL variable value, or encode it first (this is not required when calling the CapturePoint() function on Default.aspx directly). There is also a URL length limit of 2,048 for Internet Explorer.


[Last updated for version 2306 (12/2012)]
Comments