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

Multiple pins, one map #1175

Open
Rayken opened this issue Oct 6, 2017 · 0 comments
Open

Multiple pins, one map #1175

Rayken opened this issue Oct 6, 2017 · 0 comments

Comments

@Rayken
Copy link

Rayken commented Oct 6, 2017

        $meta_boxes[] = array(
            'title'     => __( 'Google Map', 'your-prefix' ),
            'fields'    => array(
                // Map requires at least one address field (with type = text)
                array(
                    'id'            => 'address',
                    'name'          => __( 'Address', 'your-prefix' ),
                    'type'          => 'text',
                    'std'           => __( 'Hanoi, Vietnam', 'your-prefix' ),
                    'clone'         => true,
                    'add_button'    => '+ Add more interesting locations',
                ),
                
                array(
                    'id'            => 'map',
                    'name'          => __( 'Location', 'your-prefix' ),
                    'type'          => 'map',
                    'region'        => 'sv',
                    
                    // Default location: 'latitude,longitude[,zoom]' (zoom is optional)
                    'std'           => '-6.233406,-35.049906,15',
                    // Name of text field where address is entered. Can be list of text fields, separated by commas (for ex. city, state)
                    'address_field' => 'address',
                    'api_key'       => 'XXXXXXXXXXX', // https://metabox.io/docs/define-fields/#section-map
                ),
            ),
        );

Basically, above doesn't work. It should add a "pin" for each address clone so one could show "interesting areas", say perhaps supermarkets and playgrounds or so. Maybe even so that each can get its own color? Just a thought.

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

No branches or pull requests

1 participant