Esri / geoportal-server

Geoportal Server is a standards-based, open source product that enables discovery and use of geospatial resources including data and services.
https://gptogc.esri.com/geoportal
Apache License 2.0
244 stars 149 forks source link

dynamic mapServiceType and setMinScale #194

Closed dave2016 closed 8 years ago

dave2016 commented 8 years ago

I have set up Geoportal version 1.2.6 on Windows and was getting an error on the Search page when mapServiceType was set to dynamic. The error said setMinScale was not a valid function. I edited gpt.js and commented out the line that called the setMinScale function and it worked. Did I set something up wrong or is that no longer a valid function?

zguo commented 8 years ago

Can you please provide the section changed in the gpt.xml to help reproduce the issue. thanks!

dave2016 commented 8 years ago

It was the gpt javascript file in the v1.2 directory. Here is the code, I commented out

service.SetMinScale(100000000000);

if (config.mapServiceType == "openstreet") { service = new esri.layers.OpenStreetMapLayer(); } else if ((config.mapServiceURL != null) && (config.mapServiceType != null)) { if (config.mapServiceType == "dynamic") { service = new esri.layers.ArcGISDynamicMapServiceLayer(config.mapServiceURL); // changed to JPG, because IE can not handle PNG24 properly (problems with paning) service.setImageFormat("jpg"); //service.setMinScale(1000000000);

On Tue, 19 Jan 2016, ZhongPing Guo wrote:

Can you please provide the section changed in the gpt.xml to help reproduce the issue. thanks!


Reply to this email directly or view it on GitHub: https://github.com/Esri/geoportal-server/issues/194#issuecomment-173003829

zguo commented 8 years ago

We tried a few geoportal instances here, but did not observe the error, setMinScale is a valid function, if you have your geoportal instance available externally, please send us the url we can take a look. thanks!

dave2016 commented 8 years ago

Our site isn't available publicly yet. I believe I found the underlying problem. When livedata.js executes I get an error "ReferenceError: require is not defined". So I don't think any of the required modules are being brought in. I'm a bit surprised anything works at all. I'm trying to figure out why "require" is not working.

dave2016 commented 8 years ago

Do you know if the dojo.js javascript file needs to be included somehow? There is not one that I can find in the geoportal directory hierarchy. There is one in the ArcGIS Server/ tomact hierarchy but I don't know how geoportal would find it.

mhogeweg commented 8 years ago

you should not have to include dojo.js explicitely as it is included in the ArcGIS JS API

dave2016 commented 8 years ago

Does the ArcGIS JS API need to be set anywhere other than the interactiveMap section of the gpt.xml file?

mhogeweg commented 8 years ago

correct, you would set that only in the gpt.xml for the main geoportal web app.

dave2016 commented 8 years ago

Any idea why I am getting the "Reference Error: require is not defined" error? I've rechecked everything I can think of and searched the Internet numerous times.

dave2016 commented 8 years ago

This is geoportal version 1.2.6. The first couple lines of the livedata.js file were

require([ "dijit/_Widget", "esri/layers/DynamicMapServiceLayer",

I changed the require line to

dojo.require([

and I no longer get the "require is not defined" error. However, I do get "_24.split is not a function". Any idea what might be causing that?

mhogeweg commented 8 years ago

what is the purpose of changing the livedata.js?

dave2016 commented 8 years ago

On Wed, 27 Jan 2016, Marten wrote:

what is the purpose of changing the livedata.js?

I'm just trying to figure out how to make it work. I noticed that the livedata.js file in the v1.2 directory uses dojo.require instead of require so I made the change to see what would happen. It seems dojo.require has been deprecated and replaced with require. But I haven't figured out why that won't work for me.

dave2016 commented 8 years ago

For geoportal v1.2.6 what should the jsapiURL be?

mhogeweg commented 8 years ago
jsapiUrl="http://js.arcgis.com/3.13/"
dave2016 commented 8 years ago

On Wed, 27 Jan 2016, Marten wrote:

jsapiUrl="http://js.arcgis.com/3.13/"

That was the problem. I was using documentation for an older version of geoportal.