Hoppa till huvudinnehållet

Maptips positioning

Kommentarer

3 kommentarer

  • Permanently deleted user

    x2 Looking for a solution myself.

    0
  • Permanently deleted user

    So here is one possible solution that we used to solve the  problem of the maptips going off the edge of screen when clicking on features located near the top or sides of the map. Essentially you can add an additional command to the map module in the viewer config. files so that it pans to the the location the user clickes on (essentialy re-centers the map on whatever feature you clicked on).

    This generally ensures that the map-tip  is always centered in the viewer.    If you don't like the idea of the map extent shifting around as the user clicks (or this would affect other aspects of your application) then this won't be good solution for you, but we found it useful for the example of an election results viewer we are building, where the only actions the user does on the map is click to invoke map tip.   (The resulting map-tip/panning behavior is very similar to what you can see here in the ESRI local government model election results viewer: http://tryitlive.arcgis.com/ElectionResults/ ).

    Here are the steps illustrated using the desktop viewer config file as an example:

    • You will have to manually edit the json config file using a text editor (make sure you first close out of the site in Manager to avoid having manager overwrite the changes you just made):
    • Typical location: C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sites\YOURSITENAME\Viewers\HTML5\VirtualDirectory\Resources\Config\Default\Desktop.json.js
    • Find the map module section and add the "PanToPoint" to the list of actions under "onClick":

     

                "moduleName" : "Map",

     

                "moduleType" : "geocortex.essentialsHtmlViewer.mapping.modules.map.MapModule",

     

                "configuration" : { 

     

                    "panDuration" : 350,

     

                    "panRate" : 50,

     

                    "zoomDuration" : 500,

     

                    "zoomRate" : 50,

     

                    "onClick" : [ "InvokeMapTip", "ClearDefaultHighlights", "PanToPoint" ],

     

                    "onFeatureClick" : [ "ShowMapTip" ],

     

                    "showLoadingStatus" : true,

     

                    "loadingMessageTiming" : [ 1000, 3000, 3000 ],

     

                    "defaultPointFeatureZoomScales" : [ ],
    • Note: You will also want to make this change to the other viewer config files for your site (e.g. tablet and handheld, etc.).

     

     

     

     

     

     

     

    0
  • Permanently deleted user
    We have recently implemented the Pan to Point feature so when a feature is clicked the map tip callout opens and the map centers to the feature. However, we are experiencing a bit of a lag in the map panning. When a feature is clicked, the call-out opens immediately, THEN the map pans, leaving the callout in the same spot of the click for a split second before it catches up with the pan and centers on the feature again. Did you experience this issue when enabling the Pan to Point functionality?

     

     

     {

     

            "moduleName": "Map",

     

            "moduleType": "geocortex.essentialsHtmlViewer.mapping.modules.map.MapModule",

     

            "configuration": {

     

              "panDuration": 350,

     

              "panRate": 50,

     

              "zoomDuration": 500,

     

              "zoomRate": 50,

     

              "longClickMilliseconds": 500,

     

              "maxExtentLogSize": 100,

     

              "showLoadingStatus": true,

     

              "loadingMessageTiming": [

     

                1000,

     

                3000,

     

                3000

     

              ],

     

              "defaultPointFeatureZoomScales": [],

     

              "behaviors": [

     

                {

     

                  "name": "MapOnClickBehavior",

     

                  "commands": [

     

                    "PanToPoint", "InvokeMapTip"

     

                  ]

     

                },
    0

Du måste logga in om du vill lämna en kommentar.