Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to set min/max zoom levels and restrict extent for base layer #310

Closed
wants to merge 34 commits into from

Conversation

krdyke
Copy link
Contributor

@krdyke krdyke commented Jun 4, 2014

Addresses #295
Added support for setting min/max zoom levels for maps using spatial layers as the base. That is, Google/Stamen/OSM baselayers are supported, as well as WMS. but I didn't implement for WMS (I can work on that if someone has a working WMS server I could use for testing. All the WMS servers I know only deal in UTM coordinates).

I used the Styles tab to house the new options. It is probably too cluttered now, but I was thinking maybe starting with these new options being "hidden" initially and then viewable by clicking "more options" or something along those lines would maintain the clarity that was there previously. I thought I'd get some feedback before pursuing that.

Hopefully my locating of the logic in the _initSpatialLayers function isn't too weird, but I can refactor!

Let me know how else I can help with the PR process (I'm a bit of a noob, if you can't tell).

screen shot 2014-06-04 at 4 33 53 pm

@davidmcclure
Copy link
Contributor

Hey @krdyke - Awesome, this looks fantastic! I'll give it a spin tomorrow morning - I might do a little refactoring of the logic in the map view to see if we can get a generalized solution that would work for WMS layers as well. Either way, let's definitely get this merged in for the next release.

@EvanPHamilton
Copy link

Sorry for the novice question, but how do I actually go about implementing this new functionality? I'd very much like to be able to set Max and Min zoom options, but not sure what code to pull.
Thanks
Evan

@waynegraham
Copy link

@EvanPHamilton The simplest way is to clone @krdyke's fork of this and check out the zoom-extent-restrict branch

$ git clone https://github.com/krdyke/Neatline.git
$ cd Neatline
$ git checkout zoom-extent-restrict

@davidmcclure have you had a chance to take a look at this yet?

@davidmcclure
Copy link
Contributor

No, my apologies folks, been really busy. I'll do my best to review this ASAP and get it merged in.

@krdyke
Copy link
Contributor Author

krdyke commented Jul 11, 2014

Let me know if I can help with anything!

On Wed, Jul 2, 2014 at 9:24 PM, davidmcclure [email protected]
wrote:

No, my apologies folks, been really busy. I'll do my best to review this
ASAP and get it merged in.


Reply to this email directly or view it on GitHub
#310 (comment).

@EvanPHamilton
Copy link

This seems to be throwing a problem with my MYSQL database. I am getting this error:

In Neatline the option of setting the min/max zoom is showing up, but I am unable to save that information.

Omeka has encountered an error

Zend_Db_Statement_Mysqli_Exception
Mysqli prepare error: Unknown column 'map_min_zoom' in 'field list'

#0 /var/www/evan/application/libraries/Zend/Db/Statement.php(115): Zend_Db_Statement_Mysqli->_prepare('INSERT INTO om...') #1 /var/www/evan/application/libraries/Zend/Db/Adapter/Mysqli.php(388): Zend_Db_Statement->__construct(Object(Zend_Db_Adapter_Mysqli), 'INSERT INTOom...')
#2 /var/www/evan/application/libraries/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Adapter_Mysqli->prepare('INSERT INTO om...') #3 /var/www/evan/plugins/Neatline/models/abstract/Neatline_Row_Abstract.php(158): Zend_Db_Adapter_Abstract->query('INSERT INTOom...', Array)
#4 /var/www/evan/plugins/Neatline/models/abstract/Neatline_Row_Abstract.php(99): Neatline_Row_Abstract->insertOrUpdate(Array)
#5 /var/www/evan/plugins/Neatline/models/abstract/Neatline_Row_Expandable.php(75): Neatline_Row_Abstract->save(false)
#6 /var/www/evan/plugins/Neatline/controllers/ExhibitsController.php(146): Neatline_Row_Expandable->save()
#7 /var/www/evan/application/libraries/Zend/Controller/Action.php(516): Neatline_ExhibitsController->importAction()
#8 /var/www/evan/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('importAction')
#9 /var/www/evan/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#10 /var/www/evan/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()
#11 /var/www/evan/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#12 /var/www/evan/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#13 /var/www/evan/admin/index.php(28): Omeka_Application->run()
#14 {main}

Just a heads up.

@EvanPHamilton
Copy link

Seemed to have fixed the problem by manually adding the columns to the database.

@waynegraham
Copy link

@EvanPHamilton Looks like we'll need to add a migration and a revision bump to make sure the migration adds the correct database fields...

@tarsierspectral
Copy link

I would like to use this functionality but I'm not sure how. Can someone help me?

@krdyke
Copy link
Contributor Author

krdyke commented Oct 2, 2014

I recently did some work rebasing this PR. @tarsierspectral, if you follow the directions for cloning given by @waynegraham above, and add the following columns to the exhibits table, you should be good to go for now.

        restricted_extent       VARCHAR(100) NULL                                    
        map_min_zoom            INT(10) UNSIGNED NULL                                       
        map_max_zoom            INT(10) UNSIGNED NULL

In the meantime, I'd be happy to add a migration to the PR, but could use some guidance on how that procedure works. I think I have a decent idea from looking at the abstract class and existing implementations in migrations/, but would appreciate some help.

P.S. WMS layers are now included. See an example with the world's most boring WMS layer here

@tarsierspectral
Copy link

@krdyke Thanks Kevin but I'm new to github and don't know what cloning means, can you explain how I would do that? Do I need Github installed?

@waynegraham
Copy link

@tarsierspectral You'll need to set up a git client (see https://help.github.com/categories/bootcamp/ for help on that). Then you'll need to either check out the fork @krdyke made (see #310 (comment)). There are other, more complicated ways to do this, but since you're new to git, we'll keep it simple.

Also, I highly recommend the git tutorial at https://try.github.io to get up to speed.

@akstuhl
Copy link
Collaborator

akstuhl commented Sep 12, 2017

Hi @krdyke, just a quick note to let you know we've rebased your feature branch into a new PR (#433) in order to catch up with the current code base and integrate your zoom/extent constraint functionality with new image layer features. Thanks for the excellent work + discussion on this; I'll close this PR now, but please don't hesitate to get in touch about any thoughts on the update.

@akstuhl akstuhl closed this Sep 12, 2017
akstuhl added a commit that referenced this pull request Sep 13, 2017
zoom level and extent limits (#310 rebased) plus image-only exhibits
@krdyke
Copy link
Contributor Author

krdyke commented Sep 13, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants