-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
marker added to center of map fixes #1148 #1149
Conversation
@jywarren I put up a marker in the center but how do I test it as there is no map showing on the page? |
Ah, I think this must go in location/form, not inside this partial, since
we only want it to show on the location selection interface. You can place
the code in a script block after the partial is included.
…On Dec 29, 2016 10:06 AM, "Mridul Nagpal" ***@***.***> wrote:
@jywarren <https://github.com/jywarren> I put up a marker in the center
but how do I test it as there is no map showing on the page?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1149 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJw6C_DG2PUjGS3B5OiWgaPOzCV_5ks5rM8x7gaJpZM4LXo54>
.
|
@jywarren Moved it to location/form |
How does it look at /locations/form ? Can you upload a screenshot? Thanks! |
@jywarren There is no map on the page |
@jywarren Okay so I tried the commands on a test file and it looks like this |
@jywarren Is this okay or do I add something else as well? |
Hi, sorry - was offline for the new year. Back now! This looks good, but do you think you could swap it for the "droplet" style marker as shown on https://publiclab.org/archive ? |
@jywarren Done |
Cool -- but does the marker move when you pan the map? I looked through the code and I wasn't sure. Thanks! |
@jywarren No it doesn't how do I do that as I went through the documentation but couldn't find anything |
Hmm, i think there are two ways to do this. One would be to constantly update the marker position, but the easier way would be to make the marker an image that's at a fixed position using CSS. The marker icon is here: https://publiclab.org/assets/leaflet/dist/images//marker-icon.png But we'd still need to listen to the map move event to return |
@jywarren Please review. |
@@ -1,4 +1,20 @@ | |||
<div style="width:100%;margin-left:0;height:300px;" id="map"></div> | |||
<style> | |||
#map { width:100%; height:300px; margin: 0; position: relative;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but actually one more change -- do you think we could change the id here to something unique, so that multiple maps could in theory appear on a page without conflicting? We could generate a unique id in Ruby using:
<%= unique_id = rand(10) %>
Then instead of #map
we'd use:
#map<%= unique_id %>
Make sense? And we'd do this addition below too on line 19. That way each map instance will be uniquely set up and controlled, even if there are multiple maps on the page.
@jywarren Done |
Will look out for the tests passing. Great work here. |
Great! 🎉 |
Make sure these boxes are checked before your pull request is ready to be reviewed and merged. Thanks!
rake test:all
schema.rb.example
has been updated if any database migrations were addedPlease be sure you've reviewed our contribution guidelines at https://publiclab.org/wiki/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays. Please alert developers on plots-dev@googlegroups.com when your request is ready or if you need assistance.
Closes #1148
Thanks!