Custom overview map

2604
4
02-25-2016 02:48 AM
AmitGautam1
New Contributor

Hi all,

I am trying to create a custom overview map widget.

1. It should be always in full extent.

2. If we zoom on map or Zoom out on map that extent should be indicated as red box in overview map.

3. If we move the red box on map, it should reflect it in map.

Can anyone suggest how can I achieve this?

0 Kudos
4 Replies
MiriamBrockmann
Occasional Contributor

Hi Amit!

You can achieve this by using Esris Overviewmap dijit.

Heres a link.

OverviewMap | API Reference | ArcGIS API for JavaScript

Regards

AmitGautam1
New Contributor

Thanks Miriam but this is for default overview map widget.

There are 3 basic need for my customize overview map which I mentioned in question.

I tried to declare a new map with full extent and pass this map to my widget but somehow its not interact with actual map navigation event.

0 Kudos
MiriamBrockmann
Occasional Contributor

So here are some Code how we initalize our Overviewmap.

We have an Menu at the upper leftside of the Screen like this where the OverviewMap is set inside

a div named "OVMap":

ov.jpg

And here's the code:

    var OVMap;

     OVMap = new ArcGISTiledMapServiceLayer(YourOVMapServiceHere);

      OVMap.on("load",function(){

                        OVMap.id = "OVMap";

                        //add the overview map

                        overviewMapDijit = new ovmap({

                            map: map,

                            baseLayer: OVMap,

                            width: 238,

                            height: 180,

                            visible: true,

                            expandFactor: 15,

                            logo:false

                        }, dom.byId('ovMap'));                       

                        overviewMapDijit.startup();

                    });

    

To your Point 1:

     You can set the expandfactor to 15 which is ( for our Map ) nearly full Extent. You have to

     Check out the level for your own Map when you set it up.

Point 2:

     The Extent of the actual MapExtent is visible in the Overview with a grey Box.

     There should be no Problem to change it to a red Frame.    

and Point 3:

     The MapExtent changes to the new Extent when you move the grey Rectangle in the Overviemap

     automatically.

Here's the Example for the use of the Overviewmap from Esri : Overview map | ArcGIS API for JavaScript

Hope this helps you!

Regards

KenBuja
MVP Esteemed Contributor

The original requirement of maintaining the full extent of the overview map when the full map is zoomed is still isn't met by changing the "expandFactor" property. There doesn't seem to be any way of doing this with the existing dijit.