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

Egypt Map #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Egypt Map #22

wants to merge 4 commits into from

Conversation

meenanader
Copy link

I have created the Egyptian map to be added into my project, which I thought it is helpful for others to use if needed.

@Indigo744
Copy link
Collaborator

Hello @meenanader !
Thanks for this PR. Do you have a working example by any chance? :)

@meenanader
Copy link
Author

Hi,

Yes I have, but I cuoldn't find a place to put an example in the Repo. Is there one?
Anyway,
Below is the example I have used:

Controller:

GeoLocationsWidgetDemoController.$inject = ['$scope', 'config'];
  function GeoLocationsWidgetDemoController ($scope, config) {
    var state;
    $scope.mapData = {
      map:{
        name : 'egypt',
        defaultArea : {
          attrsHover : {
            fill : '#242424',
            animDuration : 100
          },
          tooltip: {
            content: function(){
              return '<strong>' + state + '</strong>';
            }
          },
          eventHandlers: {
            mouseover: function(e, id){
              state = id;
            }
          }
        },
        defaultPlot:{
          size: 17,
          attrs : {
            fill : config.settings.colors['brand-warning'],
            stroke : '#fff',
            'stroke-width' : 0,
            'stroke-linejoin' : 'round'
          },
          attrsHover : {
            'stroke-width' : 1,
            animDuration : 100
          }
        },
        zoom : {
          enabled : true,
          step : 0.75,
          mousewheel: false
        }
      },
plots:{
        'EG-PTS' : {
          latitude: 29.951067,
          longitude: 32.518158,
          size: 10,
          tooltip: {content : 'EG-PTS'}
        }
      }
    };
  }

HTML:

<div class="mapael"
             data-ui-jq="mapael"
             data-ui-options="mapData">
          <div class="stats">
            <h5 class="text-white">GEO-LOCATIONS</h5>
          </div>
  </div>

[EDIT]: I took the liberty to add code tag in your comment :)

@Indigo744
Copy link
Collaborator

No, we don't have any example in this repo. I was more thinking about a JSFiddle.

@meenanader
Copy link
Author

Here is one I just created:

https://jsfiddle.net/meenanader/byw00se8/

@Indigo744
Copy link
Collaborator

The quality is good! However, I notice that the map limits are way bigger than the map actual size.
Did you trim your SVG to map limits before importing it to mapael?

Check the tutorial here: http://www.vincentbroute.fr/mapael/create-map.php

The areas in the new document may not fit with the document dimensions. In this case, go to File > Document Properties > Resize page to content, and click on the “Resize page to drawing or selection”.

@meenanader
Copy link
Author

I was not able to do that in fact from the SVG (as I used one of the existing SVG online), tried to narrow the height and width, but that does not help, specially the top part.
I may not gave enough time for that point, and properly need to look to it again as on my application it fits for purpose so I didn't think it would be an issue.
I will give it a go one more time to see if all map can fit into the needed rectangle. Or if you have a shortcut I can use that would be helpful.

@Indigo744
Copy link
Collaborator

As said in tutorial, it is fairly easy using Inkscape:

go to File > Document Properties > Resize page to content, and click on the “Resize page to drawing or selection”.

Then, import again your SVG.
Note: you will need to modify the getCoords() function to adapt to the new boundaries.

@Indigo744
Copy link
Collaborator

@meenanader, any update?

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.

2 participants