Hoppa till huvudinnehållet

creating an overmap

Kommentarer

9 kommentarer

  • Permanently deleted user

    Hi Tyler,

    The Site object in the JavaScript API has a "overviewMap" property as well as an "hasOverviewMap" property. This property is a Geocortex Map object, and will contain the configuration for your Site's overview map which can be applied to an ESRI Map control.

    You'll first want to construct your actual overview map control, for example like this:

    var esriMap = new esri.Map("myMapDivId", { /* options */});

    Once you have an overview map control set up, you can populate it using the Essentials overview map object like so;

    essentialsSite.overviewMap.loadServiceLayersInMap(esriMap); // you'll probably want to check hasOverviewMap property before doing this!

    After calling that, you should be able to create your overview map dijit as expected, passing it the ESRI map control.

    Hope this helps!

    -Jason

    0
  • Permanently deleted user

    Jason,

    I’m looking at the Geocortex Resource Center, Reference site for the JavaScript API.

     

    https://resources.geocortex.com/essentials/apis/javascript/

    I’m not seeing these properties listed as part of the Site Object.

     

    There is: hasNamedExtents, hasPrintTemplates, hasVirtualDirectory, … but no hasOverviewMap.

     

    Calling the property “hasOverviewMap”, returns ‘undefined’

    I’m using this version of the API http://apis.geocortex.com/essentials/javascript/?v=2.1

    thanks,

    Tyler

    0
  • Permanently deleted user

    Ah, I see. The overview map exists in the 2.2 version of the API.

    Version 2.2 is currently available in the HTML5 SDK package, available for download here on the support site.

    0
  • Permanently deleted user

    Version 2.2 of the API is bundled with the HTML5 SDK. It is not hosted on apis.geocortex.com.

    Download the HTML5 SDK package and look for "Essentials.js".

    0
  • Permanently deleted user

    Jason,

    Okay, downloading and using the “Essentials.js” works for my app.

    This post has gone from “creating an overview map” to the new JS API version 2.2.

    I’m going to post a new topic, see: “Geocortex JavaScript API 2.2”

    thanks,

    Tyler

    0
  • Permanently deleted user

    Jason,

    I'm still not able to get this to work. I do have an overview map defined for the site.

    esri.dijit.OverviewMap: main map does not have a base layer

    sample of my code:

    functioninit() {<p> </p>     <p> </p>     globals.OVmap = new esri.Map("OVmapDiv",{});<p> </p>        <p> </p>     globals.map = new esri.Map("mapDiv",{<p> </p>       logo: false,<p> </p>       nav:true,<p> </p>       isPanArrows: true,<p> </p>       navigationMode:'css-transforms',<p> </p>       fadeOnZoom: true});

               // Create a new Site object, supplying a URL to the REST endpoint of an existing Essentials site, and the map object just created<p> </p>             essentialsSite = new geocortex.essentials.Site(globals.SiteURI, globals.map);<p> </p>             essentialsSite.deepInitialize = true;<p> </p>    <p> </p>             // Hook up events for when the initialization of the site completes,and if it fails to initialize<p> </p>            dojo.connect(essentialsSite, "onInitialized", site_Initialized);<p> </p>            essentialsSite.initialize();  <p> </p>         }// End function init()<p> </p>    <p> </p>     function site_Initialized(sender) {<p> </p>      //config the overview map<p> </p>        essentialsSite.overviewMap.loadServiceLayersInMap(globals.OVmap);<p> </p>   <p> </p>    overviewMapDijit = new esri.dijit.OverviewMap({<p> </p>        map:globals.OVmap,<p> </p>        visible:true,<p> </p>        attachTo:"top-right",<p> </p>        color:"#D84E13",<p> </p>        opacity:.40<p> </p>      });<p> </p>     overviewMapDijit.startup();  <p> </p>   }

    Thanks,

    -Tyler

     

    0
  • Permanently deleted user

    Hi Tyler,

    It seems like the error you are getting is related to not setting a baseLayer property of your overviewMap object.

    Well, you haven't posted your entire code, so I can't tell for sure what else is wrong, but that's what I can tell in a first glance.

     

    Cheers

     

    0
  • Permanently deleted user

    Dan,

     

    Thanks for getting back to me.

     

    I’m not sure what setting a baseLayer property of my overviewMap object refers to, I was just trying use Jason's example to start from.

     

    Rather than me posting every line of code from my application to the forum, and picking over it.

     

    Perhaps a better solution would be to have a sample on the JavaScript API Samples site showing developers how they can use some of the new methods and features of the API.

    Thanks, Tyler.

    0
  • Permanently deleted user

    What I meant was, instead of:

    overviewMapDijit = new esri.dijit.OverviewMap({

     

           map:globals.OVmap,

     

           visible:true,

     

           attachTo:"top-right",

     

           color:"#D84E13",

     

           opacity:.40

     

         });

    to have:

    overviewMapDijit = new esri.dijit.OverviewMap({

           map:globals.OVmap,

     

           baseLayer: myBaseLayer,

           visible:true,

     

           attachTo:"top-right",

     

           color:"#D84E13",

     

           opacity:.40

     

         }); ? I'll try to see if I can put up a working sample of this in our samples site. Thanks  
    0

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