Scale Input Box
Will there ever be a Scale Input Box built into the HTML5 Viewer?
-
+1
yes pleeeeease!! I realise LG would be working hard on HTML5 parity - but this is a biggie!
0 -
+100!!!
0 -
+1 for me too, already asked NSG to have this added to the must have list.
0 -
+1000 from italy!
0 -
+1
We would also really like to see this!
0 -
+1000000!!!!!
0 -
+10000²
0 -
we might be able to build a workflow that zooms to scale. i will test that today. not as cool as a widget, but i could be an i want to option.
0 -
yes i just wrote a simple workflow with a form with "canned" scales. the input to the zoomtoscale command is the scale denomenator: 1:100000 would be 100000.
you might get fancier with css or the new markdown functions. but it is possible to zoom to scale with a workflow.
j
0 -
Geocortex Viewer for HTML5 does not currently support the Scale Input Box. A new feature request has been added to our wishlist for product improvements with issue number GVH-3779 . However, it has not been prioritized or scheduled for future development as of yet. I have added you to the list of stakeholders so you are notified when this gets implemented.
--Alejandro
0 -
Hi everyone,
I’ve created a scale input box that displays the current scale, and also accepts a typed scale value and zooms to that scale when the enter key is pressed while the text box has focus:
/customer/servlet/servlet.FileDownload?file=00P6000000em1Z1EAI
It may not be exactly what you are looking for, because it overwrites the current Scale Bar:
/customer/servlet/servlet.FileDownload?file=00P6000000eluJVEAY
(Given some more time to play with this, I think we could add this beside the scale bar... but this works for us for the time being).
Sharing this in case anyone else was as desperate for this functionality as we were! (With the disclaimer that I’m very new to Geocortex, and although this seems to be working great for us... there may be a better way to implement this that I’m unaware of... feedback welcome!).
Thanks,
Instructions:
1. Make sure your scale bar is enabled (Viewer -> Map Widgets -> “Show Scale Bar”)
2. Create a javascript file with the following contents:
I called ours nanaimoShowScale.js. Place the file in your equivalent of:
3. Edit your desktop.json.js to include the following:
Under libraries, add:
Under modules, add:
(don’t forget a comma after the closing brackets if these are not the last item in libraries or modules)
That should be it!
0 -
Nice Jessica,
I'll give it a go! Many thanks. I find it a bit surprising that it's not earmarked for development though...
0 -
Thanks, Jeff, that was a great idea. I wrote the workflow and added it as a button on my toolbar.
0 -
Awesome post Jessica!
I tweaked your code to add the scalebar and scale box both in the .scale-bar-host area. I also reworked it to act like the old Silverlight viewer and format the number with commas, accept commas, strip decimal parts, etc.
/customer/servlet/servlet.FileDownload?file=00P6000000eltk1EAA
Thanks!
Nick
0 -
Hi Nick, would you be able to post the tweak that allowed you to have the scale bar and input box together? Thanks in advance.
0 -
So, here's what I did to tweak Jessica's original code (note that my custom code is called "LCOGCustomShowScale")...
I really just added more code to the LCOGCustomShowScale.js file. It looks like the following (don't kill me if I didn't do this right, I am hacking my way into all this js, jQuery, and dojo stuff).
//Original code by Jessica Maple
//[Nick] Added formatting functions
function stripDecimalPart(nStr)
function addCommas(nStr)
function removeCommas(nStr)
dojo.declare("geocortex.demos.LCOGCustomShowScale", geocortex.framework.application.ModuleBase, {
Note that this does not handle internationalization issues. Probably simpler or more elegant ways to do the string-number formatting too (e.g. see http://stackoverflow.com/questions/1990512/add-comma-to-numbers-every-three-digits-using-jquery).
Note also that I only have this tested on Desktop so far, but I think it will work fine in all form factors.
I also tweaked the css file a bit:
Maybe I should have done it in em units?
Other steps to implement were the same as Jessica's.
Suggestions for improvement in reply posts are welcome.
Nick
0 -
Thanks for the post Nick. One little thing I did was remove the <p> from the line:
$( ".scale-bar-host" ).append( "<p><div id='scaleDisplayDiv'>1 : <input type='text' id='scaleTextBox' value='' style='width: 4.3em; height: 1.5em'></input></div>" );
Just to tighten up the space between the input box and the scale bar.
0 -
+1. This is critical for anyone who works with engineers! 0 -
Latitude should add this featue 0 -
+1 This should be available out of the box, as with the Silverlight viewer. This kind of functionality is fundamental to any web-based GIS solution. 0 -
+1 This is one feature that is holding us back for switching to HTML5. All my users are engineers and they can't function with out scale control. 0 -
Kudos to Jessica and Nick! It seems to only honor certain set scales, but until this function is part of the OOTB tools, this is a nice workaround. Thank you both. 0 -
According to the latest "Road Ahead" video, this feature will be available with the HTML5 Viewer, version 2.6. 0 -
I've put my scale bar into the footer, so would like to have the input box beside the scale bar rather than below it. How can I force them to be side-by-side? No matter what I try, the ScaleDisplayDiv winds up on a new line. I had already done as Mike suggested, in deleting the <P> in the $( ".scale-bar-host" ).append line. 0 -
Is the scale and extent feature near fruition? Hello? 0 -
This is available in 2.6. It displays the scale, and gives you the scales of your base cache layer as input options (HTML5 currently can only display at cached scales) 0 -
When will we have a scale input box in HTML5 that allows the user to enter any scale - not just the base cache layer scales. Has this been scheduled for development yet? We had this in Silverlight. 0 -
Hi Amy, 0 -
Am I right in reading this post that the issue is with the underlying ArcGIS JavaScript API 3.0, which limits the scales you can zoom to to those of the underlying cached map service? I've been asked by my client to implement Jessica's code. However my client is using a cached map service. From my understanding even with this code they would still not be able to zoom to a scale that is not one of the cache's scale levels. Is this correct? 0 -
I would also like to do something with inbetween scale ranges. Having switched to streamed aerial imagery now, I no longer have my own scale ranges. Is there a more structured method perhaps outside the viewer printmap... in a workflow perhaps? 0
Please sign in to leave a comment.
Comments
30 comments